本文整理汇总了VB.NET中System.Windows.Forms.ToolStripManager.Merge方法的典型用法代码示例。如果您正苦于以下问题:VB.NET ToolStripManager.Merge方法的具体用法?VB.NET ToolStripManager.Merge怎么用?VB.NET ToolStripManager.Merge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ToolStripManager 的用法示例。
在下文中一共展示了ToolStripManager.Merge方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的VB.NET代码示例。
示例1: CurrentSample
Private Property CurrentSample() As MergeSample
Get
Return currentSample1
End Get
Set
If currentSample1 <> value Then
Dim resetRequired As Boolean = False
If currentSample1 = MergeSample.MatchOnly Then
resetRequired = True
End If
currentSample1 = value
' Undo previous merge, if any.
ToolStripManager.RevertMerge(cmsBase, cmsItemsToMerge)
If resetRequired Then
RebuildItemsToMerge()
End If
Select Case currentSample1
Case MergeSample.None
Return
Case MergeSample.Append
ScenarioText = "This sample adds items to the end of the list using MergeAction.Append." + ControlChars.Cr + ControlChars.Lf + ControlChars.Cr + ControlChars.Lf + "This is the default setting for MergeAction. A typical scenario is adding menu items to the end of the menu when some part of the program is activated."
ShowAppendSample()
Case MergeSample.InsertInSameLocation
ScenarioText = "This sample adds items to the middle of the list using MergeAction.Insert." + ControlChars.Cr + ControlChars.Lf + ControlChars.Cr + ControlChars.Lf + "Notice here how the items are added in reverse order: four, three, two, one. This is because they all have the same merge index." + ControlChars.Cr + ControlChars.Lf + ControlChars.Cr + ControlChars.Lf + "A typical scenario is adding menu items to the middle or beginning of the menu when some part of the program is activated. "
ShowInsertInSameLocationSample()
Case MergeSample.InsertInSameLocationPreservingOrder
ScenarioText = "This sample is the same as InsertInSameLocation, except the items are added in normal order by increasing the MergeIndex of ""two merged items"" to be 3, ""three merged items"" to be 5, and so on." + ControlChars.Cr + ControlChars.Lf + " You could also add the original items backwards to the source ContextMenuStrip."
ShowInsertInSameLocationPreservingOrderSample()
Case MergeSample.ReplacingItems
ScenarioText = "This sample replaces a menu item using MergeAction.Replace. Use this for the MDI scenario where saving does something completely different." + ControlChars.Cr + ControlChars.Lf + ControlChars.Cr + ControlChars.Lf + "Matching is based on the Text property. If there is no text match, merging reverts to MergeIndex."
ShowReplaceSample()
Case MergeSample.MatchOnly
ScenarioText = "This sample adds only the subitems from the child to the target ContextMenuStrip."
ShowMatchOnlySample()
End Select
' Reapply with the new settings.
ToolStripManager.Merge(cmsItemsToMerge, cmsBase)
End If
End Set
End Property
开发者ID:VB.NET开发者,项目名称:System.Windows.Forms,代码行数:43,代码来源:ToolStripManager.Merge
注:本文中的System.Windows.Forms.ToolStripManager.Merge方法示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论