Another potential complication (or simplification?) is mouse driver or software programmed to send double-clicks. For example, I have the wheel button on my standard MS Wheel Mouse Optical programmed to double-click when clicked once. In practice I don't know what that sends to the app but it could be
- Two clicks separated by an extremely small time interval, maybe even less than the 0.05 second "tick" described in VFP help for _DBLCLICK
- A "deemed" double-click - although it seems the VFP .DblClick event doesn't respond to any such event per se, rather it's looking at individual clicks and processing them with _DBLCLICK
>If I'm not mistaken, problem is that the second click (of the user double-clicking) is landing on an object *after* the dropdown had "retracted" from the selection being made from the first click. If I'm not mistaken the behavior of combo box/dropdown list is to "retract" immediately after the first click, and this appears to be not affected by the setting of _DBLCLICK.
>
>>I'm making most of this up...
>>My combos have an IsDroppedDown property. It is set using the following:
>>PROCEDURE Click()
>> This.IsDroppedDown = .F.
>>
>>PROCEDURE DropDown
>>This.IsDroppedDown = .T.
>>
>>PROCEDURE KeyPress
>>LPARAMETERS nKeyCode, nShiftAltCtrl
>>WITH This
>> IF m.nKeyCode = ENTERKEY OR (m.nKeyCode = ALTUPARROWKEY AND m.nShiftAltCtrl = ALTKEY)
>> .IsDroppedDown = .F.
>> ENDIF
>>ENDWITH
>>
>>You can add a IsDroppedDown_Assign() with the normal code in it.
>>
>>* In a specific combo that you wish to behave this specific way you could override the assgn:
>>LPARAMETERS NewValue
>>IF NOT This.IsDroppedDown = m.NewValue
>> This.IsDroppedDown = m.NewValue
>> This.Parent.cnt4Area.Enabled = NOT m.NewValue
>>ENDIF
>>
>>Add a container, cnt4Area, to your form and put any controls that are in the shadow of the combo's dropdown area into it, but not the combo.
>>
>>So the DropDown sets the container's Enabled property to .F. The behavior of the container is to disable the controls so any extra click is to no effect. The controls won't react if the container in which they live is disabled. Once the dropdown is over, the container is enabled.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up