|
-
Sep 25th, 2003, 02:49 PM
#1
Thread Starter
Member
Dynamic Create ToolBarButtons
I created a dynamic toolbar like hereunder:
private sub createbuttons()
-----------------------------------
Dim tbutton As ToolBarButton
For Each menuitem In menulist
tbutton = New ToolBarButton()
...
...
AddHandler tlbPackages.ButtonClick, AddressOf DynButtonClick
tbrMenu.Buttons.Add(tbutton)
Next
Private Sub DynButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs)
----------------------------------------------------------------------------------
MessageBox.Show(e.Button.Text)
Problem:
I created a handler for buttonclick. It seems to work fine and so it is. BUT when I click on the button de "DynButtonClick" will be executed 6 times and I will see the message multiple times.
What am I doing wrong ???
PLease Help
Thanks in advanced
AXH
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|