Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox again
Message
From
10/11/2005 11:16:00
 
 
To
09/11/2005 07:43:38
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01064970
Message ID:
01067191
Views:
25
>>>>>>That's vfp. The input's (textbox, combo, checkbox, ...) controlsource is only updated after the object loses the focus.
>>>>>
>>>>>NOT TRUE.
>>>>>every input have a different behaviour ( and bugs )
>>>>
>>>>Exactly. I believe that array rowsource combos behave differently comparing with cursor's based combos.
>>>
>>>On VFP every thing works with a handful of lines different C++.
>>>
>>>The setfocus of Gregory resolves the problem because it forces a combo update/valid/Lostfocus cycle
>>>
>>>try this:
>>>
>>>thisform.cntMainInfo.cboStatusCodes.displayvalue = m.lcNewStatusCode
>>>
>>>thisform.cntMainInfo.cboStatusCodes.Value = thisform.cntMainInfo.cboStatusCodes.Value
>>>....
>>>
>>
>>Fabio,
>>
>>As a matter of intrest, why would that behave differently ?
>
>Gregory,
>I has found two minutes for a example:
>
>* CheckBox interactive update events
>*  press SPACEBAR                MOUSE CLICK
>KeyPress : NODEF stop            MouseDown
>CheckBox.internal.ReDraw         MouseUp  NODEF Stop
>CheckBox.internal.ReDraw
>ReadOnly_Access                  ReadOnly_Access
>ReadOnly_Access                  ReadOnly_Access
>InteractiveChange                InteractiveChange
>CheckBox.internal.ReDraw         CheckBox.internal.ReDraw
>                                 Value_Access
>                                 Get_ControlSource
>                                 Put_ControlSource
>Click : NODEF stop               Click : NODEF stop
>Value_Access                     Value_Access
>Get_ControlSource                Get_ControlSource
>Put_ControlSource                Put_ControlSource
>Valid : NODEF stop               Valid : NODEF stop
>TerminateRead_Access             TerminateRead_Access
>Enabled_Access                   Enabled_Access
>Value_Access                     Value_Access
>Get_ControlSource                Get_ControlSource
>Put_ControlSource                Put_ControlSource
>When : NODEF Stop                When : NODEF Stop
>Message                          Message
>
>Interesting it is to put NODEFAUL in Click,
>in this case Valid is never called,
>and while you are remaining in the checkBox the controlSource it is not modified.
>
>Fabio

Fabio,

I had not decomposed the event sequence as detailed as you have.

For the SetFocus() case, it took me hours to get to that solution. But then, that is 10 years ago.
There may be other means to accomplish the same thing.
This is the solution I've been using since and that I have in my form's base class, ie I setfocus() if the value of the controlsource of the activecontrol differs from its value
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform