ContextMenuStrip 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表一個快捷選單。
public ref class ContextMenuStrip : System::Windows::Forms::ToolStripDropDownMenu
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
public class ContextMenuStrip : System.Windows.Forms.ToolStripDropDownMenu
public class ContextMenuStrip : System.Windows.Forms.ToolStripDropDownMenu
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type ContextMenuStrip = class
inherit ToolStripDropDownMenu
type ContextMenuStrip = class
inherit ToolStripDropDownMenu
Public Class ContextMenuStrip
Inherits ToolStripDropDownMenu
- 繼承
- 屬性
範例
以下程式碼範例展示了 ContextMenuStrip 動態項目添加、動態 SourceControl 判定與重用,以及事件處理 Opening 。
// This code example demonstrates how to handle the Opening event.
// It also demonstrates dynamic item addition and dynamic
// SourceControl determination with reuse.
class Form3 : Form
{
// Declare the ContextMenuStrip control.
private ContextMenuStrip fruitContextMenuStrip;
public Form3()
{
// Create a new ContextMenuStrip control.
fruitContextMenuStrip = new ContextMenuStrip();
// Attach an event handler for the
// ContextMenuStrip control's Opening event.
fruitContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(cms_Opening);
// Create a new ToolStrip control.
ToolStrip ts = new ToolStrip();
// Create a ToolStripDropDownButton control and add it
// to the ToolStrip control's Items collections.
ToolStripDropDownButton fruitToolStripDropDownButton = new ToolStripDropDownButton("Fruit", null, null, "Fruit");
ts.Items.Add(fruitToolStripDropDownButton);
// Dock the ToolStrip control to the top of the form.
ts.Dock = DockStyle.Top;
// Assign the ContextMenuStrip control as the
// ToolStripDropDownButton control's DropDown menu.
fruitToolStripDropDownButton.DropDown = fruitContextMenuStrip;
// Create a new MenuStrip control and add a ToolStripMenuItem.
MenuStrip ms = new MenuStrip();
ToolStripMenuItem fruitToolStripMenuItem = new ToolStripMenuItem("Fruit", null, null, "Fruit");
ms.Items.Add(fruitToolStripMenuItem);
// Dock the MenuStrip control to the top of the form.
ms.Dock = DockStyle.Top;
// Assign the MenuStrip control as the
// ToolStripMenuItem's DropDown menu.
fruitToolStripMenuItem.DropDown = fruitContextMenuStrip;
// Assign the ContextMenuStrip to the form's
// ContextMenuStrip property.
this.ContextMenuStrip = fruitContextMenuStrip;
// Add the ToolStrip control to the Controls collection.
this.Controls.Add(ts);
//Add a button to the form and assign its ContextMenuStrip.
Button b = new Button();
b.Location = new System.Drawing.Point(60, 60);
this.Controls.Add(b);
b.ContextMenuStrip = fruitContextMenuStrip;
// Add the MenuStrip control last.
// This is important for correct placement in the z-order.
this.Controls.Add(ms);
}
// This event handler is invoked when the ContextMenuStrip
// control's Opening event is raised. It demonstrates
// dynamic item addition and dynamic SourceControl
// determination with reuse.
void cms_Opening(object sender, System.ComponentModel.CancelEventArgs e)
{
// Acquire references to the owning control and item.
Control c = fruitContextMenuStrip.SourceControl as Control;
ToolStripDropDownItem tsi = fruitContextMenuStrip.OwnerItem as ToolStripDropDownItem;
// Clear the ContextMenuStrip control's Items collection.
fruitContextMenuStrip.Items.Clear();
// Check the source control first.
if (c != null)
{
// Add custom item (Form)
fruitContextMenuStrip.Items.Add("Source: " + c.GetType().ToString());
}
else if (tsi != null)
{
// Add custom item (ToolStripDropDownButton or ToolStripMenuItem)
fruitContextMenuStrip.Items.Add("Source: " + tsi.GetType().ToString());
}
// Populate the ContextMenuStrip control with its default items.
fruitContextMenuStrip.Items.Add("-");
fruitContextMenuStrip.Items.Add("Apples");
fruitContextMenuStrip.Items.Add("Oranges");
fruitContextMenuStrip.Items.Add("Pears");
// Set Cancel to false.
// It is optimized to true based on empty entry.
e.Cancel = false;
}
}
' This code example demonstrates how to handle the Opening event.
' It also demonstrates dynamic item addition and dynamic
' SourceControl determination with reuse.
Class Form3
Inherits Form
' Declare the ContextMenuStrip control.
Private fruitContextMenuStrip As ContextMenuStrip
Public Sub New()
' Create a new ContextMenuStrip control.
fruitContextMenuStrip = New ContextMenuStrip()
' Attach an event handler for the
' ContextMenuStrip control's Opening event.
AddHandler fruitContextMenuStrip.Opening, AddressOf cms_Opening
' Create a new ToolStrip control.
Dim ts As New ToolStrip()
' Create a ToolStripDropDownButton control and add it
' to the ToolStrip control's Items collections.
Dim fruitToolStripDropDownButton As New ToolStripDropDownButton("Fruit", Nothing, Nothing, "Fruit")
ts.Items.Add(fruitToolStripDropDownButton)
' Dock the ToolStrip control to the top of the form.
ts.Dock = DockStyle.Top
' Assign the ContextMenuStrip control as the
' ToolStripDropDownButton control's DropDown menu.
fruitToolStripDropDownButton.DropDown = fruitContextMenuStrip
' Create a new MenuStrip control and add a ToolStripMenuItem.
Dim ms As New MenuStrip()
Dim fruitToolStripMenuItem As New ToolStripMenuItem("Fruit", Nothing, Nothing, "Fruit")
ms.Items.Add(fruitToolStripMenuItem)
' Dock the MenuStrip control to the top of the form.
ms.Dock = DockStyle.Top
' Assign the MenuStrip control as the
' ToolStripMenuItem's DropDown menu.
fruitToolStripMenuItem.DropDown = fruitContextMenuStrip
' Assign the ContextMenuStrip to the form's
' ContextMenuStrip property.
Me.ContextMenuStrip = fruitContextMenuStrip
' Add the ToolStrip control to the Controls collection.
Me.Controls.Add(ts)
'Add a button to the form and assign its ContextMenuStrip.
Dim b As New Button()
b.Location = New System.Drawing.Point(60, 60)
Me.Controls.Add(b)
b.ContextMenuStrip = fruitContextMenuStrip
' Add the MenuStrip control last.
' This is important for correct placement in the z-order.
Me.Controls.Add(ms)
End Sub
' This event handler is invoked when the ContextMenuStrip
' control's Opening event is raised. It demonstrates
' dynamic item addition and dynamic SourceControl
' determination with reuse.
Sub cms_Opening(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs)
' Acquire references to the owning control and item.
Dim c As Control = fruitContextMenuStrip.SourceControl
Dim tsi As ToolStripDropDownItem = fruitContextMenuStrip.OwnerItem
' Clear the ContextMenuStrip control's
' Items collection.
fruitContextMenuStrip.Items.Clear()
' Check the source control first.
If (c IsNot Nothing) Then
' Add custom item (Form)
fruitContextMenuStrip.Items.Add(("Source: " + c.GetType().ToString()))
ElseIf (tsi IsNot Nothing) Then
' Add custom item (ToolStripDropDownButton or ToolStripMenuItem)
fruitContextMenuStrip.Items.Add(("Source: " + tsi.GetType().ToString()))
End If
' Populate the ContextMenuStrip control with its default items.
fruitContextMenuStrip.Items.Add("-")
fruitContextMenuStrip.Items.Add("Apples")
fruitContextMenuStrip.Items.Add("Oranges")
fruitContextMenuStrip.Items.Add("Pears")
' Set Cancel to false.
' It is optimized to true based on empty entry.
e.Cancel = False
End Sub
End Class
備註
ContextMenuStrip 取代 ContextMenu。 你可以將 a ContextMenuStrip 與任何控制項關聯,右鍵點擊會自動顯示快捷鍵選單。 你可以用程式Show化的方式顯示一個ContextMenuStrip。 ContextMenuStrip 支援可取消 Opening 與 Closing 事件,以處理動態人口與多重點擊情境。 ContextMenuStrip 支援圖片、選單項目檢查狀態、文字、存取鍵、捷徑及串接選單。
以下物品專為與兩者 ToolStripSystemRenderer 無縫搭配,且 ToolStripProfessionalRenderer 適用於各種方向。 它們在設計時 ContextMenuStrip 預設可用於控制項:
捷徑選單通常用來組合表單中對使用者有用的不同選單項目 MenuStrip ,以符合應用程式的情境。 例如,你可以使用分配給 TextBox 控制項的捷徑選單,提供切換文字字型、在控制鍵內尋找文字的選單項目,或是用剪貼簿功能來複製貼上文字。 你也可以在快捷選單中暴露不 ToolStripMenuItem 在 內 MenuStrip 的新物件,以提供不適合 MenuStrip 顯示的情境特定指令。
通常,當使用者點擊滑鼠右鍵到控制項或表單本身時,會顯示一個快捷鍵選單。 許多可見的控制項,以及 Form 它本身,都有 Control.ContextMenuStrip 一個屬性,將類別綁定 ContextMenuStrip 到顯示快捷鍵選單的控制項。 多個控制項可以使用 ContextMenuStrip。
將屬性設 ToolStripDropDownMenu.ShowCheckMargin 為 , true 以便在 a ToolStripMenuItem 左側增加一個勾選標記,顯示選單項目已啟用或被選取。 屬性 ToolStripDropDownMenu.ShowImageMargin 預設會設定為 true 。 利用 左側 ToolStripMenuItem 的空格顯示該選單項目的圖片。
雖然 ContextMenuStrip 取代並新增了先前版本的控制功能 ContextMenu ,但仍 ContextMenu 保留以維持向下相容性及未來需求。
建構函式
| 名稱 | Description |
|---|---|
| ContextMenuStrip() |
初始化 ContextMenuStrip 類別的新執行個體。 |
| ContextMenuStrip(IContainer) |
初始化該類別的新實例 ContextMenuStrip ,並將其與指定的容器關聯。 |
欄位
| 名稱 | Description |
|---|---|
| ScrollStateAutoScrolling |
決定房產價值 AutoScroll 。 (繼承來源 ScrollableControl) |
| ScrollStateFullDrag |
判斷使用者是否啟用了完整視窗拖曳。 (繼承來源 ScrollableControl) |
| ScrollStateHScrollVisible |
決定屬性值是否 HScroll 設為 |
| ScrollStateUserHasScrolled |
判斷使用者是否滑動過 ScrollableControl 控制項。 (繼承來源 ScrollableControl) |
| ScrollStateVScrollVisible |
決定屬性值是否 VScroll 設為 |
屬性
| 名稱 | Description |
|---|---|
| AccessibilityObject |
讓被 AccessibleObject 指派到控制室。 (繼承來源 Control) |
| AccessibleDefaultActionDescription |
取得或設定控制項的預設動作描述,供無障礙客戶端應用程式使用。 (繼承來源 Control) |
| AccessibleDescription |
取得或設定無障礙客戶端應用程式所使用的控制項描述。 (繼承來源 Control) |
| AccessibleName |
取得或設定無障礙客戶端應用程式所使用的控制項名稱。 (繼承來源 Control) |
| AccessibleRole |
取得或設定控制的可及角色。 (繼承來源 Control) |
| AllowClickThrough |
取得或設定一個值,指示視窗沒有焦點時是否要操作的控制項。 (繼承來源 ToolStrip) |
| AllowDrop |
會取得或設定一個值,指示拖放和物品重排序是否透過你實作的事件來處理。 (繼承來源 ToolStrip) |
| AllowItemReorder |
此性質與此類別無關。 (繼承來源 ToolStripDropDown) |
| AllowMerge |
取得或設定一個值,表示多個、ToolStripDropDownMenu、ToolStripMenuItem及其他類型是否MenuStrip能組合。 (繼承來源 ToolStrip) |
| AllowTransparency |
取得或設定一個值,表示 Opacity 是否可以調整該型。 (繼承來源 ToolStripDropDown) |
| Anchor |
此性質與此類別無關。 (繼承來源 ToolStripDropDown) |
| AutoClose |
取得或設定一個值,指示控制在失去啟動時是否 ToolStripDropDown 應該自動關閉。 (繼承來源 ToolStripDropDown) |
| AutoScroll |
此性質對此類別無關。 (繼承來源 ToolStrip) |
| AutoScrollMargin |
此性質對此類別無關。 (繼承來源 ToolStrip) |
| AutoScrollMinSize |
此性質對此類別無關。 (繼承來源 ToolStrip) |
| AutoScrollOffset |
取得或設定,將此控制捲動至。ScrollControlIntoView(Control) (繼承來源 Control) |
| AutoScrollPosition |
此性質對此類別無關。 (繼承來源 ToolStrip) |
| AutoSize |
會取得或設定一個值,指示表 ToolStripDropDown 單在調整尺寸時是否自動調整大小。 (繼承來源 ToolStripDropDown) |
| BackColor |
取得或設定 的背景色。ToolStrip (繼承來源 ToolStrip) |
| BackgroundImage |
取得或設定控制中顯示的背景影像。 (繼承來源 Control) |
| BackgroundImageLayout |
取得或設定背景影像佈局,依照 ImageLayout 列舉定義。 (繼承來源 Control) |
| BindingContext |
取得或設定 的綁定上下文。ToolStrip (繼承來源 ToolStrip) |
| Bottom |
取得控制項底部邊緣與容器用戶端區域頂部邊緣之間的距離(像素)。 (繼承來源 Control) |
| Bounds |
取得或設定控制項的大小與位置,包括非用戶端元素,以像素為單位,相對於父控制項。 (繼承來源 Control) |
| CanEnableIme |
會取得一個值,表示該屬性是否 ImeMode 能被設定為主動值,以支援 IME。 (繼承來源 Control) |
| CanFocus |
會獲得一個值,表示控制點是否能獲得焦點。 (繼承來源 Control) |
| CanOverflow |
取得或設定一個值,指示 a ToolStripDropDown 中的項目是否能送入溢位選單。 (繼承來源 ToolStripDropDown) |
| CanRaiseEvents |
判斷事件是否能在控制組上引發。 (繼承來源 Control) |
| CanSelect |
會得到一個值,表示是否可以選擇該控制項。 (繼承來源 Control) |
| Capture |
取得或設定一個值,表示控制器是否已捕捉該滑鼠。 (繼承來源 Control) |
| CausesValidation |
取得或設定一個值,指示當焦點獲得時,是否 ToolStrip 會對任何需要驗證的控制項進行驗證。 (繼承來源 ToolStrip) |
| ClientRectangle |
取得代表控制區客戶端區域的矩形。 (繼承來源 Control) |
| ClientSize |
取得或設定控制區客戶區域的高度與寬度。 (繼承來源 Control) |
| CompanyName |
取得包含控制權的公司名稱或應用程式的創建者名稱。 (繼承來源 Control) |
| Container |
得到 IContainer 包含 Component的 。 (繼承來源 Component) |
| ContainsFocus |
會獲得一個值,表示該控制項或其子控制項目前是否擁有輸入焦點。 (繼承來源 Control) |
| ContextMenu |
此性質與此類別無關。 (繼承來源 ToolStripDropDown) |
| ContextMenuStrip |
此性質與此類別無關。 (繼承來源 ToolStripDropDown) |
| Controls |
此性質對此類別無關。 (繼承來源 ToolStrip) |
| Created |
會得到一個值,表示控制是否已被建立。 (繼承來源 Control) |
| CreateParams |
取得新視窗的參數。 (繼承來源 ToolStripDropDown) |
| Cursor |
當滑鼠指標位於 .ToolStrip (繼承來源 ToolStrip) |
| DataBindings |
取得控制項的資料綁定。 (繼承來源 Control) |
| DataContext |
取得或設定資料上下文以進行資料綁定。 這是一個環境音屬性。 (繼承來源 Control) |
| DefaultCursor |
取得或設定控制鍵的預設游標。 (繼承來源 Control) |
| DefaultDock |
取得 的 ToolStrip對接位置,表示哪些邊界已停靠在貨櫃上。 (繼承來源 ToolStripDropDown) |
| DefaultDropDownDirection |
取得或設定相對於 ToolStrip的ToolStripDropDown顯示方向。 (繼承來源 ToolStripDropDown) |
| DefaultGripMargin |
它會取得預設的像素間距,介於尺寸握把和 ToolStrip邊緣之間。 (繼承來源 ToolStrip) |
| DefaultImeMode |
可獲得控制項所支援的預設輸入法編輯器(IME)模式。 (繼承來源 Control) |
| DefaultMargin |
取得 與 之間的間距,以像素為單位。ToolStripToolStripContainer (繼承來源 ToolStrip) |
| DefaultMaximumSize |
取得控制項預設最大大小的長度與高度(像素數)。 (繼承來源 Control) |
| DefaultMinimumSize |
取得控制項預設最小大小的長度與高度(像素)。 (繼承來源 Control) |
| DefaultPadding |
可以取得控制器內部的像素間距。 (繼承來源 ToolStripDropDownMenu) |
| DefaultShowItemToolTips |
會有一個值,表示預設是否會顯示 ToolStripDropDown 工具提示。 (繼承來源 ToolStripDropDown) |
| DefaultSize |
會得到預設大小的 ToolStrip。 (繼承來源 ToolStrip) |
| DesignMode |
會得到一個值,表示目前 Component 是否處於設計模式。 (繼承來源 Component) |
| DeviceDpi |
取得目前顯示控制項所在顯示器的 DPI 值。 (繼承來源 Control) |
| DisplayedItems |
取得目前顯示在 ToolStrip的項目子集,包括自動加入 ToolStrip的項目。 (繼承來源 ToolStrip) |
| DisplayRectangle |
取得代表顯示區域 ToolStripDropDownMenu的矩形。 (繼承來源 ToolStripDropDownMenu) |
| Disposing |
會取得一個值,表示基底 Control 類別是否正在處理中。 (繼承來源 Control) |
| Dock |
此性質與此類別無關。 (繼承來源 ToolStripDropDown) |
| DockPadding |
可以取得控制器所有邊緣的底座填充設定。 (繼承來源 ScrollableControl) |
| DoubleBuffered |
會取得或設定一個值,指示該控制器是否應該使用次級緩衝區重新繪製表面以減少或防止閃爍。 (繼承來源 Control) |
| DropShadowEnabled |
會獲得或設定一個值,表示在顯示時 ToolStripDropDown 是否會出現三維陰影效果。 (繼承來源 ToolStripDropDown) |
| Enabled |
取得或設定一個值,表示控制項是否能回應使用者互動。 (繼承來源 Control) |
| Events |
會取得與此 Component連結的事件處理程序清單。 (繼承來源 Component) |
| Focused |
會得到一個值,表示控制器是否有輸入焦點。 (繼承來源 Control) |
| Font |
取得或設定顯示在 ToolStripDropDown. 上的文字字型。 (繼承來源 ToolStripDropDown) |
| FontHeight |
取得或設定控制鍵字型的高度。 (繼承來源 Control) |
| ForeColor |
取得或設定 的前景色 ToolStrip。 (繼承來源 ToolStrip) |
| GripDisplayStyle |
此性質與此類別無關。 (繼承來源 ToolStripDropDown) |
| GripMargin |
此性質與此類別無關。 (繼承來源 ToolStripDropDown) |
| GripRectangle |
此性質與此類別無關。 (繼承來源 ToolStripDropDown) |
| GripStyle |
此性質與此類別無關。 (繼承來源 ToolStripDropDown) |
| Handle |
它會得到控制項綁定的視窗把手。 (繼承來源 Control) |
| HasChildren |
此性質對此類別無關。 (繼承來源 ToolStrip) |
| Height |
取得或設定控制點的高度。 (繼承來源 Control) |
| HorizontalScroll |
此性質對此類別無關。 (繼承來源 ToolStrip) |
| HScroll |
會取得或設定一個值,表示水平滾動條是否可見。 (繼承來源 ScrollableControl) |
| ImageList |
取得或設定包含物品上 ToolStrip 顯示圖片的圖片清單。 (繼承來源 ToolStrip) |
| ImageScalingSize |
取得或設定用於 ToolStrip的影像大小(像素)。 (繼承來源 ToolStrip) |
| ImeMode |
取得或設定控制器的輸入法編輯器(IME)模式。 (繼承來源 Control) |
| ImeModeBase |
取得或設定控制的 IME 模式。 (繼承來源 Control) |
| InvokeRequired |
會獲得一個值,表示呼叫者在呼叫控制項時是否必須呼叫呼叫方法,因為呼叫者使用的執行緒與該控制項建立的執行緒不同。 (繼承來源 Control) |
| IsAccessible |
取得或設定一個值,指示該控制項是否對無障礙應用程式可見。 (繼承來源 Control) |
| IsAncestorSiteInDesignMode |
顯示該控制點的前祖是否被設置在 DesignMode 中。 這個屬性是唯讀的。 (繼承來源 Control) |
| IsAutoGenerated |
會得到一個值,表示這 ToolStripDropDown 是否是自動產生的。 (繼承來源 ToolStripDropDown) |
| IsCurrentlyDragging |
會取得一個值,表示使用者目前是否正在從 ToolStrip 一個 ToolStripContainer 移動到另一個。 (繼承來源 ToolStrip) |
| IsDisposed |
會有一個值,表示控制權是否已被處理掉。 (繼承來源 Control) |
| IsDropDown |
會得到一個值,表示 a ToolStrip 是否為控制項 ToolStripDropDown 。 (繼承來源 ToolStrip) |
| IsHandleCreated |
會得到一個值,表示該控制項是否有與其相關的 handle。 (繼承來源 Control) |
| IsMirrored |
會得到一個值,表示該控制是否為鏡像。 (繼承來源 Control) |
| Items |
取得所有屬於 ToolStrip. (繼承來源 ToolStrip) |
| LayoutEngine |
傳遞由佈局引擎介面回傳的快取 LayoutEngine 參考。 (繼承來源 ToolStripDropDownMenu) |
| LayoutSettings |
取得或設定佈局方案的特性。 (繼承來源 ToolStrip) |
| LayoutStyle |
取得或設定一個值,表示 的 ContextMenuStrip 項目如何顯示。 (繼承來源 ToolStripDropDownMenu) |
| Left |
取得或設定控制項左邊與容器客戶端區域左邊之間的距離(像素)。 (繼承來源 Control) |
| Location |
此性質與此類別無關。 (繼承來源 ToolStripDropDown) |
| Margin |
取得或設定控制區之間的空格。 (繼承來源 Control) |
| MaximumSize |
取得或設定的上限是可以指定的上限 GetPreferredSize(Size) 。 (繼承來源 Control) |
| MaxItemSize |
取得 的最大高度與寬度(像素數) ContextMenuStrip。 (繼承來源 ToolStripDropDownMenu) |
| MinimumSize |
取得或設定的尺寸是可指定的下限 GetPreferredSize(Size) 。 (繼承來源 Control) |
| Name |
取得或設定控制的名稱。 (繼承來源 Control) |
| Opacity |
決定表單的不透明度。 (繼承來源 ToolStripDropDown) |
| Orientation |
獲得 的方向 ToolStripPanel。 (繼承來源 ToolStrip) |
| OverflowButton |
此性質與此類別無關。 (繼承來源 ToolStripDropDown) |
| OwnerItem |
取得或設定 ToolStripItem ,那是這個 ToolStripDropDown的擁有者。 (繼承來源 ToolStripDropDown) |
| Padding |
在控制範圍內設置或設置填充。 (繼承來源 Control) |
| Parent |
取得或設定控制的父容器。 (繼承來源 Control) |
| PreferredSize |
大小相當於一個長方形區域,控制器可以放進去。 (繼承來源 Control) |
| ProductName |
取得包含控制項的組件產品名稱。 (繼承來源 Control) |
| ProductVersion |
取得包含控制項的組裝版本。 (繼承來源 Control) |
| RecreatingHandle |
會取得一個值,表示該控制項目前是否正在重新建立其句柄。 (繼承來源 Control) |
| Region |
取得或設定與 ToolStripDropDown相關的視窗區域。 (繼承來源 ToolStripDropDown) |
| Renderer |
取得或設定一個 ToolStripRenderer 用來自訂外觀與感覺的 ToolStrip。 (繼承來源 ToolStrip) |
| RenderMode |
取得或設定一個值,指示將套用哪些視覺風格。ToolStrip (繼承來源 ToolStrip) |
| RenderRightToLeft |
已淘汰.
已淘汰.
該物業現已過時。 (繼承來源 Control) |
| ResizeRedraw |
會取得或設定一個值,表示控制項在調整時是否會自行重新繪製。 (繼承來源 Control) |
| Right |
取得控制器右邊與容器用戶端區域左邊之間的距離(像素)。 (繼承來源 Control) |
| RightToLeft |
取得或設定一個值,指示 control 元素是否對齊以支援使用右至左字型的區域。 (繼承來源 ToolStripDropDown) |
| ScaleChildren |
會得到一個決定子控制項縮放的值。 (繼承來源 Control) |
| ShowCheckMargin |
取得或設定一個值,指示是否在左 ToolStripMenuItem邊顯示勾選標記的空格。 (繼承來源 ToolStripDropDownMenu) |
| ShowFocusCues |
會得到一個值,指示控制器是否應該顯示焦點矩形。 (繼承來源 Control) |
| ShowImageMargin |
取得或設定一個值,指示影像的空間是否顯示在 的 ToolStripMenuItem左邊邊緣。 (繼承來源 ToolStripDropDownMenu) |
| ShowItemToolTips |
取得或設定一個值,指示是否要在物品上 ToolStrip 顯示工具提示。 (繼承來源 ToolStrip) |
| ShowKeyboardCues |
會取得一個值,表示使用者介面是否處於顯示或隱藏鍵盤加速器的適當狀態。 (繼承來源 Control) |
| Site |
取得或設定控制點。 (繼承來源 Control) |
| Size |
設定控制器的高度與寬度。 (繼承來源 Control) |
| SourceControl |
會取得最後一個導致此現象顯示的 ContextMenuStrip 控制項。 |
| Stretch |
此性質與此類別無關。 (繼承來源 ToolStripDropDown) |
| TabIndex |
此性質與此類別無關。 (繼承來源 ToolStripDropDown) |
| TabStop |
取得或設定一個值,指示使用者是否能使用 TAB 鍵將焦點分配給某 ToolStrip 項目。 (繼承來源 ToolStrip) |
| Tag |
取得或設定包含控制項資料的物件。 (繼承來源 Control) |
| Text |
取得或設定與此控制項相關的文字。 (繼承來源 Control) |
| TextDirection |
指定在物品上繪製文字的方向。 (繼承來源 ToolStripDropDown) |
| Top |
取得或設定控制面板頂端與容器用戶端區域頂端之間的距離(以像素為單位)。 (繼承來源 Control) |
| TopLevel |
取得或設定一個值,表示是否 ToolStripDropDown 為頂層控制。 (繼承來源 ToolStripDropDown) |
| TopLevelControl |
取得沒有被其他 Windows Forms 控制項保護的父控制權。 通常,這是控制所包含的最 Form 外層。 (繼承來源 Control) |
| TopMost |
取得或設定一個值,指示表單是否應該顯示為最頂表單。 (繼承來源 ToolStripDropDown) |
| UseWaitCursor |
取得或設定一個值,指示是否使用等待游標來控制目前的控制項及所有子控制項。 (繼承來源 Control) |
| VerticalScroll |
此性質對此類別無關。 (繼承來源 ToolStrip) |
| Visible |
會取得或設定一個值,表示 是 ToolStripDropDown 可見還是隱藏。 (繼承來源 ToolStripDropDown) |
| VScroll |
會取得或設定一個值,表示垂直捲動條是否可見。 (繼承來源 ScrollableControl) |
| Width |
設定或設定控制寬度。 (繼承來源 Control) |
| WindowTarget |
此性質對此類別無關。 (繼承來源 Control) |
方法
事件
明確介面實作
| 名稱 | Description |
|---|---|
| IDropTarget.OnDragDrop(DragEventArgs) |
引發 DragDrop 事件。 (繼承來源 Control) |
| IDropTarget.OnDragEnter(DragEventArgs) |
引發 DragEnter 事件。 (繼承來源 Control) |
| IDropTarget.OnDragLeave(EventArgs) |
引發 DragLeave 事件。 (繼承來源 Control) |
| IDropTarget.OnDragOver(DragEventArgs) |
引發 DragOver 事件。 (繼承來源 Control) |