Someone told me there were only 4 toolbars in vb.net. I thought there were than that. Can anyone shed some light on this?

Dani AI

Generated

The confusion usually comes from mixing platforms and old vs. new controls. For Windows Forms (VB.NET desktop apps) there is the legacy ToolBar control and the newer ToolStrip family introduced in .NET 2.0. The ToolStrip family provides the flexible UI pieces you see in the toolbox (MenuStrip, ToolStrip, StatusStrip and supporting container/panel classes) and replaces most uses of the old ToolBar. If you were working in ASP.NET Web Forms instead, there is a different server-side ToolBar control (System.Web.UI.WebControls.ToolBar), so counts will look different depending on project type. This explains why someone might say “four” — they were likely referring to the common ToolStrip-related toolbox items, not a strict limit.

A minimal example to add a ToolStrip with one text button in a WinForms form:

Dim ts As New ToolStrip()
Dim btn As New ToolStripButton()
btn.Text = "Click"
btn.DisplayStyle = ToolStripItemDisplayStyle.Text
AddHandler btn.Click, AddressOf ToolStripButton_Click
ts.Items.Add(btn)
Me.Controls.Add(ts)

Private Sub ToolStripButton_Click(sender As Object, e As EventArgs)
    MessageBox.Show("Button clicked")
End Sub

Quick troubleshooting and notes:

  • If toolbar controls are missing from the toolbox, confirm the project type is Windows Forms and the target .NET version supports ToolStrip.
  • Old ToolBar uses an ImageList and ImageIndex; ToolStripButton uses an Image property and DisplayStyle.
  • Use ToolStrip for modern apps — it supports overflow, drop downs and better rendering.

For reference, see the Microsoft docs on ToolStrip controls and the ASP.NET ToolBar control for the server-side behavior: and . This should clear up why saw conflicting answers and why asked for clarification.

You are pretty vaugue in your question can u give me a clue?

Please elaborate on the question then i might help

Thanks I figured it out

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.