none
ToolStrip Renderer RRS feed

  • Question

  • Hi all

    I have a WinForm with a Menu Strip and several ToolsStripMenu Items. 

    One of this ToolstripMenuItem has several subitems.

    I wish to divide the list of these subitems in two groups, drawing two rectangles, one around  the first group and another around the second group.

    How to do that using ToolStrpRenderer  ?

    Thank for help

    Tuesday, October 30, 2018 9:16 AM

Answers

  • Hi Alex

    it can be a solution, but, how can i do it programmatically?

    Hi,

    code

    Public Class Form1
        Dim toolStripSeparator1 As New ToolStripSeparator
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Me.TestToolStripMenuItem.DropDownItems.AddRange(New ToolStripItem() {Me.NewToolStripMenuItem, Me.OpenToolStripMenuItem, Me.toolStripSeparator1, Me.SaveToolStripMenuItem, Me.ExitToolStripMenuItem})
        End Sub
    End Class

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Claudio111 Wednesday, October 31, 2018 9:53 AM
    Wednesday, October 31, 2018 1:18 AM

All replies

  • Hi,

    Do you want this effect?

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, October 30, 2018 9:53 AM
  • Hi Alex

    it can be a solution, but, how can i do it programmatically?

    Tuesday, October 30, 2018 10:58 AM
  • Hi Alex

    it can be a solution, but, how can i do it programmatically?

    Hi,

    code

    Public Class Form1
        Dim toolStripSeparator1 As New ToolStripSeparator
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Me.TestToolStripMenuItem.DropDownItems.AddRange(New ToolStripItem() {Me.NewToolStripMenuItem, Me.OpenToolStripMenuItem, Me.toolStripSeparator1, Me.SaveToolStripMenuItem, Me.ExitToolStripMenuItem})
        End Sub
    End Class

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Claudio111 Wednesday, October 31, 2018 9:53 AM
    Wednesday, October 31, 2018 1:18 AM
  • it is Ok with just the separator 

    Thank Alex

    Wednesday, October 31, 2018 9:54 AM