Notifications
Clear all

[Closed] Dotnet controls fighting for focus

 lo1

Thanks, this will prove very helpful. Looks like I have to rewrite a lot of stuff :argh:

 lo1

Just noticed something… in your panel example… I can’t seem to write any text in the comboboxes, the max viewport seems to have focus no matter what. Is there any way around this? :hmm:

edit: Got it… enableAccelerators = false

edit2: Do you know if there is an event of the Panel class which can catch if any of the children controls of the panel get focus? ‘enter’ and ‘gotfocus’ don’t seem to catch this, and it’s tedious to add a ‘gotfocus’ event for each of the panels controls just to disable the accelerators.

 lo1

I’m afraid I don’t understand. The link you posted describes a .ContainsFocus property, not an event. How can I call the changing of a property as an event?

Or did you mean I should set up a timer to periodically check whether or not the panel contains focus?

Sorry, my bad, I thought it was an event! I’ll try to check the code to see if I can do what you need.

I just noticed one thing… why do you want to disable the accelarators inside of each panel? I’ve just added a enableAccelerators = false in the FocusTest open event and it seems to work fine, at least for one panel… dunno how it works with more panels.

 lo1

I works the first time, but try this:

  1. run the script
  2. type something in the combobox (works fine so far…)
  3. click somewhere in the viewport to defocus the rollout
  4. try typing something again…

No worries though, I added an event for each combobox.

Page 2 / 2