ToolTip.StripAmpersands 屬性

定義

取得或設定值,以便判斷連字號 (&) 字元的處理方式。Gets or sets a value that determines how ampersand (&) characters are treated.

public:
 property bool StripAmpersands { bool get(); void set(bool value); };
[System.ComponentModel.Browsable(true)]
public bool StripAmpersands { get; set; }
public bool StripAmpersands { get; set; }
[<System.ComponentModel.Browsable(true)>]
member this.StripAmpersands : bool with get, set
member this.StripAmpersands : bool with get, set
Public Property StripAmpersands As Boolean

屬性值

Boolean

如果連字號字元會從工具提示文字中刪除,則為 true,否則為 falsetrue if ampersand characters are stripped from the ToolTip text; otherwise, false. 預設為 false。The default is false.

屬性

備註

應用程式通常會針對多個用途(例如功能表項目和工具提示)使用相同的字串資源。An application commonly uses the same string resource for multiple purposes, such as a menu item and a ToolTip. 不過,功能表通常會在功能表項目字串中啟用快速鍵(以連字號字元表示)。However, menus often enable accelerators, denoted by an ampersand character, in the menu item string. 工具提示不支援這項功能,因此根據預設,& 只會顯示為一般字元。ToolTips do not support this capability, so by default, ampersands are just displayed as normal characters. 設定 StripAmpersands 屬性以 true 移除工具提示文字中的所有 &。Setting the StripAmpersands property to true removes all ampersands from the ToolTip text.

適用於

另請參閱