Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

How to make Custom Tool Bar using VB.Net

Author: DevASP
Download Source Code : 415_Custom_Too1bar.zip

The Custom tool bar, allows you to add other controls the tool bar you might ask, "why do we need this?". Well My answer is easy.

This should fix the issue and provide you with a better toolbar.

There are several new methods and one new property.

  •  Auto_Adjust_controls
  •  AddControl
  •  RemoveControl
  •  ClearControls
  •  ItemControl

 

In Add Control Button‘s Click Event add these line of code

You can add any control by this method.

 

ToolBar1.ClearControls()

        Dim x As Integer

        For x = 0 To 5

            Dim Btn As New Button()

            Btn.Text = "Button " & x

            Btn.Name = "button" & x

            ToolBar1.AddControl(Btn)

        Next

For clear the control add this code, ToolBar1.ClearControls(), For fore color Write this code. For this  You make instance of Color dialog box Place this If Condition.

Dim CD As New ColorDialog()

        If CD.ShowDialog() <> DialogResult.Cancel Then

            ToolBar1.ItemControl(TextBox1.Text).ForeColor = CD.Color

        End If

 

And for dock Property write code for the left, right, top, bottom side place control Write these line of code.

 

ToolBar1.Dock = DockStyle.Left

ToolBar1.Dock = DockStyle.Bottom

ToolBar1.Dock = DockStyle.Top

ToolBar1.Dock = DockStyle.Right

 

Source code is given with this article for your understanding.

Article Comments
hello!

Posted on 2/21/2010 4:38:17 PM by yehia

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< How to Hide Select Query Strings using ASP.Net and VB.Net

Disclaimer - Privacy
© 2002-2017 DevASP.net