Justin
Justin

Reputation: 219

How to put underline under button name

I have button with name "itemname", and now I want to put underline just under character "i" in "itemname", but I don't know how I should do this. Could anyone please tell me how?

Upvotes: 3

Views: 9718

Answers (4)

Girish b g
Girish b g

Reputation: 11

You should add an "&" to left of the letter you want to underline. So, a button with text "&itemname" will have the "i" underlined. and you can get focused to the button by pressing "alt+i"

Upvotes: 1

Mikel
Mikel

Reputation: 25606

Do you mean you want Alt+I to click the button?

Have you tried changing the label text from itemname to &itemname?

Upvotes: 1

Frédéric Hamidi
Frédéric Hamidi

Reputation: 262939

You need to use an ampersand character (&) to do that:

yourButton.Text = "&itemname";

See http://msdn.microsoft.com/en-us/library/az5a73z1.aspx.

Upvotes: 15

sh0uzama
sh0uzama

Reputation: 600

You should add an "&" to left of the letter you want to underline. So, a button with text "&itemname" will have the "i" underlined.

Upvotes: 1

Related Questions