Solved Open form with no focus

donkey9972

Registered User.
Local time
Today, 00:45
Joined
May 18, 2008
Messages
124
Hi again, I have a question which some might find weird. How can I open a form and have nothing on it with the focus? A little background on why, I have a form that when I open I want the subform to not be visible (done). I have several buttons on it that when one is selected it stays highlighted until another button is selected (done). However, the code I was using before to keep the subform hidden still works, keeps the form hidden. The problem is I am using the on click part of the buttons for the highlight code. I have tried to put focus on a hidden text box, but errors saying it can't go to that. Any ideas or help on this is much appreciated.
 
The common approach is to send the focus to a 1x1 pixel control that you'll add on the form.
 
Ah I see. But doesn't the outline still show up once it has the focus? or is the some way to disguise that?
 
You don’t have to set a 1 pixel width and height- they can both be 0..
 
There is an exception to the rule about focus. It is possible to set focus to the whole form if there are no controls on that form that can get focus. Things like lines and rectangles that are not bindable (have no .ControlSource) can be set up so that they cannot get focus. But if you disable all controls, it IS possible to do a Me.SetFocus from code and have it work. The tricky part is, from where did you run that code?
 

Users who are viewing this thread

Back
Top Bottom