I've modified the 'uSimpleBrowser' demo but I loose the 'activecontrol' once the chomiumwindow1 loads the content.
I have a listbox containing 20,000 png file names referring to files on disk. When the item in the list is clicked on, the file is loaded into the browser. However, even though the activecontrol is set to the list box, the 'down arrow' and 'up arrow' are not operational to select the next or prior item in the list. The arrows keys operate against chomiumwindow. The listbox must be clicked and then the arrow keys become functional to load the item but then the chomiumwindows still regains control over the arrow keys.
I've even added a timer for 200 ms to always set the active control to the listbox.
Does anyone have a recommended solution to using the arrow keys?
Thanks
reel.time
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
chomiumwindow1 and listbox
- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: chomiumwindow1 and listbox
Hi,
Try setting ChromiumWindow1.ChromiumBrowser.DefaultWindowInfoExStyle to WS_EX_NOACTIVATE before the ChromiumWindow1.CreateBrowser call.
Try setting ChromiumWindow1.ChromiumBrowser.DefaultWindowInfoExStyle to WS_EX_NOACTIVATE before the ChromiumWindow1.CreateBrowser call.
Re: chomiumwindow1 and listbox
Nope. Setting ChromiumWindow1.ChromiumBrowser.DefaultWindowInfoExStyle to WS_EX_NOACTIVATE before the ChromiumWindow1.CreateBrowser didn't work. 

- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: chomiumwindow1 and listbox
Use the TChromium.OnSetFocus event to cancel setting the focus to the browser.
Add this line in TForm1.FormCreate
And implement the TChromium.OnSetFocus event like this :
Add this line in TForm1.FormCreate
Code: Select all
ChromiumWindow1.ChromiumBrowser.OnSetFocus := ChromiumBrowser_OnSetFocus;
Code: Select all
procedure TForm1.ChromiumBrowser_OnSetFocus(Sender: TObject; const browser: ICefBrowser; source: TCefFocusSource; out Result: Boolean);
begin
Result := True;
end;
Re: chomiumwindow1 and listbox
That worked beautifully.. Thank you SO very much!!!!!!!




