本文整理汇总了VB.NET中System.Windows.Forms.ToolStripManager.FindToolStrip方法的典型用法代码示例。如果您正苦于以下问题:VB.NET ToolStripManager.FindToolStrip方法的具体用法?VB.NET ToolStripManager.FindToolStrip怎么用?VB.NET ToolStripManager.FindToolStrip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ToolStripManager
的用法示例。
在下文中一共展示了ToolStripManager.FindToolStrip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: applyButton_Click
' This event handler is invoked when
' the "Apply Renderers" button is clicked.
' Depending on the value selected in a ComboBox
' control, it applies a custom renderer selectively
' to individual MenuStrip or ToolStrip controls,
' or it applies a custom renderer to the
' application as a whole.
Sub applyButton_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim ms As ToolStrip = ToolStripManager.FindToolStrip("MenuStrip")
Dim ts As ToolStrip = ToolStripManager.FindToolStrip("ToolStrip")
If targetComboBox.SelectedItem IsNot Nothing Then
Select Case targetComboBox.SelectedItem.ToString()
Case "Reset"
ms.RenderMode = ToolStripRenderMode.ManagerRenderMode
ts.RenderMode = ToolStripRenderMode.ManagerRenderMode
' Set the default RenderMode to Professional.
ToolStripManager.RenderMode = ToolStripManagerRenderMode.Professional
Exit Select
Case "All"
ms.RenderMode = ToolStripRenderMode.ManagerRenderMode
ts.RenderMode = ToolStripRenderMode.ManagerRenderMode
' Assign the custom renderer at the application level.
ToolStripManager.Renderer = New CustomProfessionalRenderer()
Exit Select
Case "MenuStrip"
' Assign the custom renderer to the MenuStrip control only.
ms.Renderer = New CustomProfessionalRenderer()
Exit Select
Case "ToolStrip"
' Assign the custom renderer to the ToolStrip control only.
ts.Renderer = New CustomProfessionalRenderer()
Exit Select
End Select
End If
End Sub