Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
120
Drag and drop into UltraStatusBar
posted

Is it possible to drag and drop into a ultra status bar? The idea is that the status bar has buttons on which the user should be able to drop. Each button has its on logic for what kind of drop it accepts  and the drag drop indicator should change accordingly as the user drags over the status bar.

Parents
No Data
Reply
  • 12480
    Verified Answer
    Offline posted

    Hello,

    I've pasted below a code snippet of the DragOver event handler for the UltraStatusBar:

     

     

     

    private void ultraStatusBar1_DragOver(object sender, DragEventArgs e)
    {
       foreach (UltraStatusPanel panel in
     ultraStatusBar1.Panels)
       {
          Rectangle 
    rect = panel.UIElement.Rect;
         
    Point p = ultraStatusBar1.PointToClient(new Point
    (e.X, e.Y));

         
    if
    (p.X > rect.X && p.X < rect.X + rect.Width)
          {
             panel.Text =
    "Drop!"
    ;
          }
          else
         
    {
            
    panel.Text = string.Empty;
          }
       }
    }

    This checks the x coordinate of the mouse pointer, converts it to client space, then looks at each panel's UIElement to see where the user dropped the data.

    Please let me know if you have any further questions. 

Children