简体   繁体   中英

VB.net - DevExpress WindowsUIButtonPanel

I have been trying to define click event for 6 buttons I have created in the WINDOWSUIBUTTONPANEL but I am unable to do so. I have tried:

    Private Sub WindowsUIButtonPanel1_Click(sender As Object, e As EventArgs) Handles WindowsUIButtonPanel1.ButtonClick
**THINGS TO DO**
    End Sub

But all the buttons do the same
I tried to add:

For Each WindowsUIButtonPanel1.Buttons.OfType(1)

        Next

But again it does not work Can someone help me on this please

Thanks

I suggest you use the following approach:

Private Sub WindowsUIButtonPanel1_ButtonClick(sender As Object, e As DevExpress.XtraBars.Docking2010.ButtonEventArgs) Handles WindowsUIButtonPanel1.ButtonClick
    If e.Button Is WindowsUIButtonPanel1.Buttons(0) Then
        Debug.WriteLine("Button 0")
        ' do something
    End If
    If e.Button Is WindowsUIButtonPanel1.Buttons(1) Then
        Debug.WriteLine("Button 1")
        ' do something
    End If
End Sub

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM