Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Drag string from List into Box of FlowChart (Read 1401 times)
airmix
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Nov 12th, 2006
Drag string from List into Box of FlowChart
Nov 12th, 2006 at 11:38pm
Print Post  
Hi,

I create the ListBox, I would like to drag one string into the Box. Next, i would this string will show into the another ListBox. (the string will add the Box's text).
I use DragOver and DragDrop events, it is only for the flow chart but there is no any event for DragDrop event of Box. How can i handle the event to drag?
Thanks All!!!!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag string from List into Box of FlowChart
Reply #1 - Nov 13th, 2006 at 6:50am
Print Post  
Hi,

Try this:

Code
Select All
private void fc_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
{
  // we have the screen point of the mouse, but need it in document C.S.
  Point clientPt = fc.PointToClient(new Point(e.X, e.Y));
  PointF docPt = fc.ClientToDoc(clientPt);

  // if there is a box here
  Box box = fc.GetBoxAt(docPt);
  if (box != null && e.Data.GetDataPresent(DataFormats.Text))
  {
    string s = (string)e.Data.GetData(DataFormats.Text);
    box.Text = s;
  }
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint