Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Category:
Coding, syntax & commands
>>>I would like to have the following functionality. Drag an item from a listbox over a command button and fire the click event of the button. Is this possible?
>>>
>>>When I try it, the button's click event does not fire. I've put this.click() in the button's Dragover event. Am I missing something or is this simply not possible in VFP?
>>>
>>>TIA
>>>Mike
>>
>>Yes, it's possible.
>>
>>You have to set properties of CommandButton: OLEDragMode = 1-Automatic, OLEDropMode = 1-Enabled. You have to put this.Click() in OLEDragOver.
>
>I tried you suggestion and it still does not work for me. Please remember that I'm trying to do this all within a VFP form, i.e. native VFP listbox and commandbutton.
>
>Do you have any sample code that you could share?
You have to set also same properties in Listbox: OLEDragMode = 1-Automatic, OLEDropMode = 1-Enabled. In order to see from CommandButton item from Listbox put in Listbox.OLEStartDrag() reference to Listbox item. For example make PUBLIC variable gcItem = this.List[this.ListIndex] and then you can use that variable from CommandButton.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only