We help IT Professionals succeed at work.

Keeping the focus on the same form

moonrise
moonrise asked
on
Medium Priority
274 Views
Last Modified: 2010-04-04
I have two forms which are visible at all time. One has some buttons, the other one has a TEdit. I want the Tedit to have the focus at all time. When the user clicks on the button, of course the focus goes to that form. Is there a way to prevent a form to get the focus, even if a component on that form is clicked. Right now I just have a OnClick event for everything on the form with the button that sets the focus back to the form with the edit button. It works but I would prefer a cleaner solution, like a form property that prevents the form from getting the focus.
Comment
Watch Question

Commented:
I don't think it's possible.
I would be interesed if it is.
Are you trying to make a button to stay in the caption area of the first button?

Viktor Ivanov
Are you trying to make a button to stay in the caption area of the first button?

Viktor Ivanov

Commented:
Try make Form2(with Edit) modal.
After that you could not switch to Form1

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Hi Jacco,

It works just as you said.  Thank you.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.