Version

UnderlineAccessKey Property

This property allows to automatically underline a character in the Text which matches with AccessKey property.
Syntax
'Declaration
 
Public Property UnderlineAccessKey As Boolean
public bool UnderlineAccessKey {get; set;}
Remarks

Note: To create underline appearance,- the first character in the text which matches with the AccessKey is rendered with the <u> tags.

Example
The Text property defines the displayed text. The UnderlineAccessKey allows to automatically modify value of Text in order to generate "underline" tags for a particular character in text.

' Following codes will underline the 1st "l" character in the text
' which is the letter "l" in the word "Underlined"
Me.WebImageButton1.Text = "Underlined Letter"
Me.WebImageButton1.AccessKey = "L"
Me.WebImageButton1.UnderlineAccessKey = True

' Below is alternative example to underline not 1st (any) character in text.
' Following codes will underline the "L" character in word text.
Me.WebImageButton1.Text = "Underlined <u>L</u>etter"
Me.WebImageButton1.AccessKey = "L"
Me.WebImageButton1.UnderlineAccessKey = False

' Below is an example to break text on 3 lines and show 2nd line in bold and 3rd line in italic font.
Me.WebImageButton1.Text = "Normal 1st line<br><b>Bold text</b><br><i>Italic text</i>"

' Notes:
' If any html-format-tags are used for the Text property, then it
' will distroy the ability to set text of button on the client side.
' If codes above are written within aspx, then it reduces the size of hidden ViewState passed to client
// Following codes will underline the 1st "l" character in the text
// which is the letter "l" in the word "Underlined"
this.WebImageButton1.Text = "Underlined Letter";
this.WebImageButton1.AccessKey = "L";
this.WebImageButton1.UnderlineAccessKey = true;

// Below is alternative example to underline not 1st (any) character in text.
// Following codes will underline the "L" character in word text.
this.WebImageButton1.Text = "Underlined <u>L</u>etter";
this.WebImageButton1.AccessKey = "L";
this.WebImageButton1.UnderlineAccessKey = false;


// Below is an example to break text on 3 lines and show 2nd line in bold and 3rd line in italic font.
this.WebImageButton1.Text = "Normal 1st line<br><b>Bold text</b><br><i>Italic text</i>";

// Notes:
// If any html-format-tags are used for the Text property, then it
// will distroy the ability to set text of button on the client side.
// If codes above are written within aspx, then it reduces the size of hidden ViewState passed to client.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also