Quantcast
Channel: Our ComponentOne » All Posts
Viewing all articles
Browse latest Browse all 14170

Reply To: Determine selected item in toolbar from context menu.

$
0
0

Hi,

I assume that you have a "C1ToolBar"? Otherwise this would be the wrong place for this question ;-) .

Here is a VB.Net snippet which handles the "MouseClick" event of a C1ToolBar and displays the name of the clicked item:

  Private Sub c1ToolBar_MouseClick(sender As Object, e As MouseEventArgs) Handles c1ToolBar.MouseClick
    If (e.Button = Windows.Forms.MouseButtons.Right) Then
      For Each link As C1CommandLink In c1ToolBar.CommandLinks
        If (link.Bounds.Contains(e.Location)) Then
          MessageBox.Show(Me, "You clicked " + link.Command.Name)
        End If
      Next
    End If
  End Sub

Hope this helps

Wolfgang


Viewing all articles
Browse latest Browse all 14170

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>