Son riuscito a trovare un esempio.
Purtroppo oltre al comando che interessa a me c'è intorno tanto codice inutile.
In questo momento della mia preparazione non sono ancora in grado di togliere le righe senza fare danni.
Per favore, qualcuno mi può dire quali sono le istruzioni da usare nel caso in cui il menù sia stato inserito nel modo classico?
codice:
Class Form5
Inherits Form
Public Sub New()
' Size the form to show three wide menu items.
Me.Width = 500
Me.Text = "ToolStripContextMenuStrip: Image and Check Margins"
' Create a new MenuStrip control.
Dim ms As New MenuStrip()
' Create the ToolStripMenuItems for the MenuStrip control.
Dim noMargins As New ToolStripMenuItem("NoMargins")
' Customize the DropDowns menus.
' This ToolStripMenuItem has no image and no check margin.
noMargins.DropDown = CreateCheckImageContextMenuStrip()
CType(noMargins.DropDown, ContextMenuStrip).ShowImageMargin = False
CType(noMargins.DropDown, ContextMenuStrip).ShowCheckMargin = False
' Populate the MenuStrip control with the ToolStripMenuItems.
ms.Items.Add(noMargins)
' Dock the MenuStrip control to the top of the form.
ms.Dock = DockStyle.Top
' Add the MenuStrip control to the controls collection last.
' This is important for correct placement in the z-order.
Me.Controls.Add(ms)
End Sub
' This utility method creates a ContextMenuStrip control
Friend Function CreateCheckImageContextMenuStrip() As ContextMenuStrip
' Create a new ContextMenuStrip control.
Dim checkImageContextMenuStrip As New ContextMenuStrip()
' Create a ToolStripMenuItem with no
' check margin and no image margin.
Dim noCheckNoImage As New ToolStripMenuItem("No Check, No Image")
noCheckNoImage.Checked = False
' Add the ToolStripMenuItems to the ContextMenuStrip control.
checkImageContextMenuStrip.Items.Add(noCheckNoImage)
Return checkImageContextMenuStrip
End Function
End Class