DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Drap & Drop Toolbar

  1. #1
    Kevin Moore Guest

    Drap & Drop Toolbar


    Hi,

    I would like to implement the following functionality in our application
    but I am having trouble with a specific part. Our application is MDI based
    and involves using grids to display listing of information. We have a toolbar
    at the top of our MDI window. I would like to allow our users the ability
    to drag from the grids to the toolbar. I have implemented code to begin
    the dragging process from the grids, but when the dragging gets to the toolbar
    I am stumped. The question I have is: How can I determine what button the
    dragged item is being dropped on? The DragDrop event only contains x & y
    parameters.

    Thanks,

    Kevin

  2. #2
    Patrick Marshall Guest

    Re: Drap & Drop Toolbar


    Hi Kevin,

    You could do some simple arithmetic to calculate the index of the button
    receiving the drag-drop. You can safely ignore the y value (unless you have
    a vertical toolbar in which you use y and ignore x!).

    dim ButtonIndexInt as integer
    const kButtonWidth = ???? 'I'm assuming you are using big buttons if you
    are doing a drag-drop operation (small buttons are hard to target for most
    users).

    ButtonIndexInt = x\kButtonWidth 'note integer division "\"

    Given the index of the button you should be able to get the key or whatever
    property you are using to fire the button code.

    Hope this helps.

    <Patrick>

    "Kevin Moore" <Kevin@MooreSSI.com> wrote:
    >
    >Hi,
    >
    >I would like to implement the following functionality in our application
    >but I am having trouble with a specific part. Our application is MDI based
    >and involves using grids to display listing of information. We have a toolbar
    >at the top of our MDI window. I would like to allow our users the ability
    >to drag from the grids to the toolbar. I have implemented code to begin
    >the dragging process from the grids, but when the dragging gets to the toolbar
    >I am stumped. The question I have is: How can I determine what button the
    >dragged item is being dropped on? The DragDrop event only contains x & y
    >parameters.
    >
    >Thanks,
    >
    >Kevin



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center