You can create a toolbar at design time or through code. Click on either of the following links to expand the steps for the designer or for the code.
To create a toolbar at design time
To create a C1ToolBar using its Link to Command designer, complete the following steps;.
At run time, the toolbar appears like the following image:
To create a toolbar programmatically
To programmatically create a C1ToolBar with text buttons, complete the following steps:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Imports C1.Win.C1Command Dim ch As C1CommandHolder = C1CommandHolder.CreateCommandHolder(Me) |
To write code in C#
C# |
Copy Code
|
---|---|
using C1.Win.C1Command; C1CommandHolder ch = C1CommandHolder.CreateCommandHolder(this); |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Dim tb As New C1ToolBar() Me.Controls.Add(tb) |
To write code in C#
C# |
Copy Code
|
---|---|
C1ToolBar tb = new C1ToolBar(); this.Controls.Add(tb); |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
tb.CommandHolder = ch Dim cFile As New C1Command() cFile.Text = "File" |
To write code in C#
C# |
Copy Code
|
---|---|
tb.CommandHolder = ch; C1Command cFile = new C1Command(); cFile.Text = "File"; |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Dim cl As C1CommandLink cl = New C1CommandLink(cFile) tb.CommandLinks.Add(cl) |
To write code in C#
C# |
Copy Code
|
---|---|
C1CommandLink cl = new C1CommandLink(cFile); tb.CommandLinks.Add(cl); |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
cl.ButtonLook = ButtonLookFlags.Text Dim cView As New C1Command() cView.Text = "View" |
To write code in C#
C# |
Copy Code
|
---|---|
cl.ButtonLook = ButtonLookFlags.Text; C1Command cView = new C1Command(); cView.Text = "View"; |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
cl = New C1CommandLink(cView) tb.CommandLinks.Add(cl) |
To write code in C#
C# |
Copy Code
|
---|---|
cl = new C1CommandLink(cView); tb.CommandLinks.Add(cl); |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
cl.ButtonLook = ButtonLookFlags.Text Dim mEdit As New C1Command() mEdit.Text = "Edit" |
To write code in C#
C# |
Copy Code
|
---|---|
cl.ButtonLook = ButtonLookFlags.Text; C1Command mEdit = new C1Command(); mEdit.Text = "Edit"; |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
cl = New C1CommandLink(mEdit) tb.CommandLinks.Add(cl) |
To write code in C#
C# |
Copy Code
|
---|---|
cl = new C1CommandLink(mEdit); tb.CommandLinks.Add(cl); |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
cl.ButtonLook = ButtonLookFlags.Text |
To write code in C#
C# |
Copy Code
|
---|---|
cl.ButtonLook = ButtonLookFlags.Text; |
The toolbar appears like the following: