468,556 Members | 2,232 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,556 developers. It's quick & easy.

Setting control focus with visual confirmation of same

Another newbie question I'm afraid. When I use the .Focus() or .Select()
methods to set the initial control that has focus on a form, try as I might I
cannot get the control to visually indicate that it has the focus (e.g. a
dotted outline around the caption of a RadioButton). The visible and enabled
properties are set to true, and I know that the desired control has the focus
(in this case one of two or more RadioButtons located in a GroupBox) as using
the Up/DownArrow etc. keys I can cycle through which RadioButton is selected,
yet the selected RadioButton has no outlined caption (i.e. there is no visual
confirmation of which contral has Focus). However, if I then Tab to the next
control and Shift-Tab back, the dotted line appears around the relevant
caption. It seems as though the first press of the Tab key triggers the next
selected control to show that it has Focus? Is this correct, and more
importantly, can I do this in code so that the desired first-Focus control
has the dotted outline? I'm sure that I'm missing something simple, but
having previously coded in VB4 the change in Syntax is causing me a few
problems!

BTW, I am using the .Select()/.Focus() method after the "'Add any
initialization after the InitializeComponent() call " rem statement in the
'Public Sub New()' routine: I hope that this is correct or is there a more
suitable place to put this event?

Many thanks for any replies.
Nov 21 '05 #1
0 1307

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Melissa | last post: by
2 posts views Thread by Mystery Man | last post: by
12 posts views Thread by CLEAR-RCIC | last post: by
1 post views Thread by clickon | last post: by
7 posts views Thread by Zytan | last post: by
5 posts views Thread by Finn Stampe Mikkelsen | last post: by
3 posts views Thread by kelvin.koogan | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.