Reputation: 219
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
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
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
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
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