ComponentOne WebMenus and WebBars for ASP.NET: WebMenus and WebBars for ASP.NET Task-Based Help > C1WebMenu Tasks > Adding a Button to a Horizontal Menu

Adding a Button to a Horizontal Menu

To programmatically add a button control to a horizontal C1WebMenu, use the following code:

      Visual Basic

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

   Dim btn As Button = New Button

   btn.Text = "Go!"

   C1WebMenu1.Controls.Add(btn)

End Sub

      C#

private void Page_Load(object sender, System.EventArgs e)

{

   Button btn = new Button();

   btn.Text = "Go!";

   C1WebMenu1.Controls.Add(btn);

}


Send comments about this topic to ComponentOne.
Copyright © 1987-2009 ComponentOne LLC. All rights reserved.