Nevron.UI.Winform.Controls.NCommand


https://www.nevron.com/Forum/Topic6762.aspx
Print Topic | Close Window

By Paul Mead - 12 Years Ago
Currently, I have a request from a client so that when a Nevron.UI.Winform.Controls.NCommand is Moused Down that it will scroll the graph below the button. My problem is there is no Event that I can attach to the object created. Are there any suggestions on how to accomplish this? I tried extending the object but I don't have access to the particular UI object, or at least I haven't found the UI object. Help?
By Nevron Support - 12 Years Ago
Hi Paul,

You can attach to whole NDockingToolbar.MouseDown event and check which command contains the mouse location:

nDockingToolbar1.MouseDown += new MouseEventHandler(nDockingToolbar1_MouseDown);

...

void nDockingToolbar1_MouseDown(object sender, MouseEventArgs e)
{
   if (e.Button == MouseButtons.Left)
   {
      int nCount = nDockingToolbar1.Commands.Count;
      for (int i = 0; i < nCount; i++)
      {
         NCommand command = nDockingToolbar1.Commands[i];
         if (command.VisualState.Bounds.Contains(e.Location))
         {
            clickedCommand = command;
            return;
         }
      }
   }
}