Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Class by Mark McCasland
Message
From
25/07/2001 11:23:57
 
 
To
25/07/2001 11:17:26
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00534643
Message ID:
00535064
Views:
13
This message has been marked as a message which has helped to the initial question of the thread.
Hi!

Pardon for jumping in.

We faced the same problem with combobox when tried some smart combobox refreshing code. When you change anything in combobox that bound to data field that can cause the field being marked as changed, even when you do 'Combo.Value=Combo.Value' or 'Combo.ListIndex=Combo.ListIndex'. The only proper way I know for refreshing the combobox is to use 'Combo.ControlSource=Combo.ControlSource' - when Value is in the list, combobox is refreshed correctly and value is selected, but data field is not marked as a change.

BTW, quick way to check if anything changed:
'2' $ getfldstate(-1)

HTH.

>>>>>>Add a method to the combo, call it whatever you like. Move all the Init code to that method. When you are ready to load the data into the combo, issue a call to that method.
>>>>>
>>>>>Mark,
>>>>>
>>>>>That worked, but given my situation I also had to move around some mQuery calls to other methods and put a check in so the code (formerly in Init) in my new method ran only once. Thanks!
>>>>>
>>>>>Renoir
>>>>
>>>>Mark,
>>>>
>>>>One followup question... I use GetFldState() to determine if changes have been made to the view field values in case a user cancels the edit. Using your class it always returns that it has been changed even though no selection was done. Do you know if this is a result of your class logic or a nuance of the GetFldState() function? Thanks!
>>>>
>>>>Renoir
>>>
>>>Mark,
>>>
>>>Ok, I found what is causing it, but I'm unsure what to do about it. In your Init code is the following line:
>>>
>>>
>>>.Value = luValue
>>>
>>>
>>>This flips the field's status from a 1 to a 2. Any idea's on how I could handle this and not lose the functionality of your class? Thanks!
>>>
>>>Renoir
>>
>>You can save the original value in a property of combo. Then you can compare two values - Original and the new value.
>
>Nadya,
>
>I'm using the GetFieldStatus() in my form's cancel method to determine if any of the (many) fields have changed for the active view. If any have I inform the user and ask them if they would like to save the changes. I'm using a compare like the following:
>
>
>lcFldState = alltrim(getfldstate(-1))
>   If lcFldState != replicate('1',len(lcFldState))
>
>
>I'm not sure I can use your suggestion in my case. Can I? If not, do you have any other ideas? Thanks!
>
>Renoir
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform