[Gambas-user] Drag and Drop - howto

Rolf-Werner Eilert rwe-sse at osnanet.de
Wed Apr 18 12:43:43 CEST 2018


Am 18.04.2018 um 12:09 schrieb Benoît Minisini:
> Le 18/04/2018 à 11:51, Rolf-Werner Eilert a écrit :
>> Last year I started a project which could benefit from dragging 
>> elements from one GridView to another with the mouse.
>>
>> As I was still developing the deeper code, I didn't take the time to 
>> dive in this, and this year I would like to complete it. Just had a 
>> look at the old code parts, and still do not grasp how these Drag, 
>> MouseDrag etc. are meant to work together.
>>
>> Public Sub GridView1_MouseDrag()
>>
>>     TextBox1.Text = GridView1.Row & "::" & GridView1.Column
>>
>> End
>>
>> This starts as expected, but then keeps going - even beyond the 
>> borders of GridView1. This makes it somewhat combersome if you need a 
>> start value to be handed over to the drop point. I only see a chance 
>> when setting a flag at its first call and saving the value(s) only once.
>>
>> Public Sub GridView1_Drop()
>>
>>    TextBox1.Text = "Stop"
>>
>> End
>>
>> This one is never raised, neither when the mouse button is depressed 
>> whithin nor when without GridView1.
>>
>> Why are there events called Mouse-something and NOT Mouse-something?
>>
>> Maybe someone here can shed a light on this for me.
>>
>> Regards
>> Rolf
>>
> 
> Have you read the page about "Drag & Drop" on the wiki?
> 

Nope, is there? I never found one. At least I cannot remember... ;)

Regards
Rolf



More information about the User mailing list