none
How do i add menu separator programmatically in VB / VB script..

    Question

  • I know how to add menu separator in under UI, but how can i add it programmatically , any code sample is appreciated..

    thanks

    kirann

    Wednesday, April 21, 2010 12:30 PM

Answers

  • add a menu item with the Text "_"
    Para el correcto funcionamiento, y que otros usuarios se puedan beneficiar de la solucion de esta pregunta por favor marca las respuestas que te hayan ayudado como "Respuesta".
    Si la respuesta te ha sido util Votala.
    Mi Blog: Jtorrecilla
    Enlace a Faq de Winforms en Ingles Muy bueno
    Wednesday, April 21, 2010 12:31 PM
  • U can use hyphen '-' instead of the underscore '_' for better divider look.

    look here for how to do it.

    http://www.vb6.us/tutorials/working-menus-vb6

    Wednesday, April 21, 2010 1:53 PM
  • Hiiii, Add This Code to Form Load:

    Dim

     

    MenuStrip1 As New System.Windows.Forms.MenuStrip

    MenuStrip1.Location =

    New System.Drawing.Point(0, 0)

    MenuStrip1.Name =

    "MenuStrip1"

    MenuStrip1.Size =

    New System.Drawing.Size(608, 24)

     

    Dim FileToolStripMenuItem As New ToolStripMenuItem

    FileToolStripMenuItem.Name =

    "mnuFile"

    FileToolStripMenuItem.Text =

    "File"

    MenuStrip1.Items.Add(FileToolStripMenuItem)

     

    Dim AddToolStripMenuItem As New ToolStripMenuItem

    AddToolStripMenuItem.Name =

    "mnuAdd"

    AddToolStripMenuItem.Text =

    "Add"

    FileToolStripMenuItem.DropDownItems.Add(AddToolStripMenuItem)

     

    Dim MyToolStripSeparator1 As New ToolStripSeparator

    MyToolStripSeparator1.Name =

    "MySeparator1"

    FileToolStripMenuItem.DropDownItems.Add(MyToolStripSeparator1)

     

    Dim UpdateToolStripMenuItem As New ToolStripMenuItem

    UpdateToolStripMenuItem.Name =

    "mnuUpdate"

    UpdateToolStripMenuItem.Text =

    "Update"

    FileToolStripMenuItem.DropDownItems.Add(UpdateToolStripMenuItem)

     

    Me.Controls.Add(MenuStrip1)

    Thursday, April 22, 2010 7:37 AM

All replies

  • add a menu item with the Text "_"
    Para el correcto funcionamiento, y que otros usuarios se puedan beneficiar de la solucion de esta pregunta por favor marca las respuestas que te hayan ayudado como "Respuesta".
    Si la respuesta te ha sido util Votala.
    Mi Blog: Jtorrecilla
    Enlace a Faq de Winforms en Ingles Muy bueno
    Wednesday, April 21, 2010 12:31 PM
  • U can use hyphen '-' instead of the underscore '_' for better divider look.

    look here for how to do it.

    http://www.vb6.us/tutorials/working-menus-vb6

    Wednesday, April 21, 2010 1:53 PM
  • Hiiii, Add This Code to Form Load:

    Dim

     

    MenuStrip1 As New System.Windows.Forms.MenuStrip

    MenuStrip1.Location =

    New System.Drawing.Point(0, 0)

    MenuStrip1.Name =

    "MenuStrip1"

    MenuStrip1.Size =

    New System.Drawing.Size(608, 24)

     

    Dim FileToolStripMenuItem As New ToolStripMenuItem

    FileToolStripMenuItem.Name =

    "mnuFile"

    FileToolStripMenuItem.Text =

    "File"

    MenuStrip1.Items.Add(FileToolStripMenuItem)

     

    Dim AddToolStripMenuItem As New ToolStripMenuItem

    AddToolStripMenuItem.Name =

    "mnuAdd"

    AddToolStripMenuItem.Text =

    "Add"

    FileToolStripMenuItem.DropDownItems.Add(AddToolStripMenuItem)

     

    Dim MyToolStripSeparator1 As New ToolStripSeparator

    MyToolStripSeparator1.Name =

    "MySeparator1"

    FileToolStripMenuItem.DropDownItems.Add(MyToolStripSeparator1)

     

    Dim UpdateToolStripMenuItem As New ToolStripMenuItem

    UpdateToolStripMenuItem.Name =

    "mnuUpdate"

    UpdateToolStripMenuItem.Text =

    "Update"

    FileToolStripMenuItem.DropDownItems.Add(UpdateToolStripMenuItem)

     

    Me.Controls.Add(MenuStrip1)

    Thursday, April 22, 2010 7:37 AM