バージョン

UnderlineAccessKey プロパティ

このプロパティでは、AccessKeyプロパティに一致するText内の特定の文字に自動的に下線を付けることができます。
シンタックス
'宣言
 
Public Property UnderlineAccessKey As Boolean
public bool UnderlineAccessKey {get; set;}
解説

注: 下線の外観を作成するには、AccessKey に一致するテキストの先頭文字に <u> タグを付けて描画します。

使用例
' 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.
参照