Moving the focus to nowhere.

P

Proko

I seem to remember a method of making the focus move to an invisible button
on a form, making it appear that there was no control with the focus. Can
someone enlighten me on how this is done (or some other method). Thanks
 
P

Proko

Thanks Rick

Rick Brandt said:
Setting focus to an invisible control is not possible. You can however, set
focus to a button or TextBox that is so small that it cannot be seen.
 
M

Mr B

As an extension of what Rick has already said, If i need a form to appear to
not have any control that has the focus, I normally use a text box for this
purpose. I create the text box, and name it "txtHoldCursor". I then set its
left positon and its width to zero. This will place the new text box at the
left edge of my form and its with to nothing. I then make this text box the
first contro in the Tab Order of my form. I then use code to set the focus
to this control when I do not want any other control to have the focus.
 
D

DS

Rick said:
Setting focus to an invisible control is not possible. You can however, set
focus to a button or TextBox that is so small that it cannot be seen.
Make a command button.
Set it to transparent with no caption.

Use this to focus on it.
Me.CommandButton.SetFocus

DS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top