Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default Button on Form (VB 2008)

I want to find a way to make a specific button, the form's default button, I.e. the button that is highlighted when the form opens for the first time.

I tried the AcceptButton property but when I run the program, that does not work.

Any idea?

Thank you in advance,

Tassos

like image 574
Tassos Avatar asked Jan 19 '23 14:01

Tassos


1 Answers

You need to change the AcceptButton property of the containing form.

form1.AcceptButton = button1

Here form1 is the Form whose default button you need to set, and button1 is the name of the Button on that form.

like image 146
chk Avatar answered Jan 31 '23 00:01

chk