Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide Image Margin in Second Menu

Status
Not open for further replies.

pickletech

IS-IT--Management
Dec 20, 2004
88
0
0
US
Hello everyone. I have a simple context menu strip with three tiers, so it looks something like this:

Tier 1 Tier 2 Tier 3
Shutdown -> Shutdown -> Computer1
Computer2
Computer3
Reboot -> Computer1
Computer2
Computer3

I cannot figure out how to get rid of the image margins in the second and third tier. Does anyone know how to do this?
Thank You,
Pickletech
 
This is really cheating, and I don't know if there are any hidden issues, but the ContextMenuStrip includes a ShowImageMargin property which you can make use of:
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Dim ms As New MenuStrip

    Dim mnuFile As New ToolStripMenuItem("File")

    Dim mnuFile_Test As New ToolStripMenuItem("Test")

    Dim cm As New ContextMenuStrip

    cm.Items.Add(New ToolStripMenuItem("Hello"))

    cm.ShowImageMargin = False

    mnuFile.DropDownItems.Add(mnuFile_Test)

    mnuFile_Test.DropDown = cm

    ms.Items.Add(mnuFile)

    Me.Controls.Add(ms)

    Me.MainMenuStrip = ms

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top