Hi All
Trying to get this working from the docs but I’m obviously missing something (code below). I drag from the list row and get a nice little rectangle as expected, drag it over the canvas … but when I drop, it simply bounces back to the ListBox *using a little animation, which is nice but, obviously, that’s not quite what I was after.
Another connected problem is that I’m sending the MousePosition(X) data (via a var) to a label so the user has a better idea where they’re dropping the object but it won’t update during drag. Updates fine on MouseMove but as soon as that left button is down it opts out.
Can anyone please tell me what I’m missing? Thank you.
ListBox1
DragRow Event
Var p As Picture = Self.BitmapForCaching(colWidth, 24)
p.Graphics.DrawingColor = &cffffff
p.Graphics.FillRectangle(mCurrentColumn, 24, colWidth, 24)
drag.DragPicture = p
drag.Text = txt
Return True
end DragRow Event
Canvas1
open event
Me.AcceptPictureDrop
Me.AcceptTextDrop
Me.AcceptRawDataDrop("????")
end open event
MouseUp Event
// Update mouse position and store it in MousePosition Property
MousePosition = New Point(x, y)
// refresh, without erasing the background
Me.Refresh(False)
end MouseUp Event
paint event
If DropPic Is Nil Then Return
g.DrawPicture(DropPic, 0, 0, g.Width, g.Height, 0, 0, DropPic.Width, DropPic.Height)
end paint event
MouseMove event
// Store mouse position as MousePosition Property
MousePosition = New Point(x, y)
// refresh, without erasing the background
Me.Refresh(False)
end MouseMove Event
MouseDown Event
Return True
end MouseDown Event
DragOver Event
Return True
end DragOver Event