Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

How to set dotted rectangle on the first tabindex button

$
0
0

Hi All

I met a problem when I am setting tabindex and focus on a button, my situation is this: I have a Form, and there are several child controls in it, I intend to let the button whose tabIndex is 0 have a dotted rectangle in it when I first launched Form.

To get to that, I have tried:

button1.focus() in Shown event of the Form, but after the form shown firstly, there is only a light blue rectangle circling the button, when I hit tab, the dotted rectangle appears in the second button with tabIndex=1. If I change the first button to a textbox with tabIndex still equals "0" and launching the form, the textbox can get the cursor blinking. 

I also tried a MessageBox, when it is shown, the "OK" button has a dotted rectangle in it.

If someone has idea on how to achieve my goal, please help.

My developing tool is VS2005 C#.


Viewing all articles
Browse latest Browse all 12583

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>