Anyone would like to tell me what is the function for setting focus point as the program start executing? For example i have 3 command buttons that is arrange vertically... by default the program will focus on the middle button by having dotted line surround the button. What i should include to make it focus on the top / bottom button?

if your form_activate()


To set focus for the control you can use the Setfocus property,

write the Following code in the Form_Activate event

Private Sub Form_Activate()
End Sub

One more possible way to achive this one is,

try with the Tab index property

Set the Tabindex '0' for the control which you want to Set the Focus by default.

Hope this will help you,

With regards

Venkatramasamy SNa

if your form_activate()


ooopps... sorry i think it's C#.... its Command1.SetFocus.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.