PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Richard Kelly on April 26, 2010, 04:27:40 AM

Title: Focus/Activation
Post by: Richard Kelly on April 26, 2010, 04:27:40 AM
After I open a form with it's Show function, I cannot figure out how to have that newly opened non-modal form have keyboard focus. I have tried every combination of FF_Control_ShowState and even tried SetActiveWindow. Setting focus on a control on the new form doesn't do anything either. I can click on the window and then it gets focus but want to avoid that extra step. What say you window wizards?

I got it....PostMessage with %WM_SETFOCUS does the trick....
Title: Re: Focus/Activation
Post by: Rolf Brandt on April 26, 2010, 05:13:10 AM
Hmm.., usually the new form should have the focus automatically. But maby I didn't understand the problem properly.

I added a minimum project with two forms. Form1 has a button to whow Form2. Form2 has a textbox. When you open Form2 (modal or nonmodal) the textbox on Form2 has the focus.
Title: Re: Focus/Activation
Post by: Richard Kelly on April 26, 2010, 05:16:39 AM
The forms I was having issues with use listviews and buttons. The listview is at the top of the tab order and the first row is shown as selected but the form did not have the focus. %WM_SETFOCUS works on these forms....I never expected such a quick response at this hour.... 8)
Title: Re: Focus/Activation
Post by: Rolf Brandt on April 26, 2010, 05:38:58 AM
Response probably has to do with location - it is 10:00 am here (Germany).

Remember - the sun never sets in the FireFly Kingdom. (...or was that another kindgom?)
Title: Re: Focus/Activation
Post by: Richard Kelly on April 26, 2010, 05:54:22 AM
Midnight in Alaska, USA at 61 degrees north latitude where it is quickly getting to the point where the sun will still be up.... :D