Hi,
I've been reading about TdxBarControlContainerItem and setting focus to it's control and this doesn't seem to be easy.
From what I read, the focus gets lots again because the control is placed on it's own internal TForm descendant.
I've been trying to get this done via Window messages, but no luck either. The only thing that -appears- to work is using a TTimer that sets the focus after a little while.
Now, this is somewhat "not so ideal", I think.
Wouldn't it be nice if the component would trigger an event -after placing- it on the TForm during run-time, so that you can use some code that would make it focussed, if required, by the application?
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hi Martijn,
We've discussed this functionality with our developers, and seem to need more information to understand how it should work. Please provide a brief sample illustrating the scenario when this even might be helpful.
Regards,
Serge
Well, as you know, the control only becomes visible after the next paint operation, meaning that a call to SetFocus results in "Cannot focus a disabled or invisible window". I've tried sending window messages, but as your code places it on a TPlaceForm, the message gets lost.
Now, if the TdxBarControlContainerItem would trigger some kind of event "After" a paint operation, pass a parameter to ask if it would need focussing for keyboard input, we developers could respond to that and don't have to go through hoops with TTimers etc to set the contained control to receive keyboard focus.
Ok, Martijn, thank you for the clarification.
Thanks,
Serge
See Also:
TdxBarControlContainerItem - Makes it possible to use a control which has window handle in a submenu
Workaround:
How to Programmatically Set Focus to an ControlContainerItem
Yes, I know of the workaround, it's a pain to implement (over and over again)… That's why I created this request ;)