Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox with negative value ???
Message
From
03/06/1998 09:32:17
 
 
To
03/06/1998 03:07:43
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00103942
Message ID:
00104355
Views:
27
>>>I've wrote a combo sub-class that allows the user to select the type of graph he wants. The combo has 2 columns: One with the description of the type, another one with the constant value of the charttype property. Value is bounded to column 2. When the user selects an option, i assign the charttype as the value of the combo.
>>>All works fine, even if the value is a negative one, but i'm not able to initialize the value of the combo to a negative value. I've tried in the init event of the control, in the init of the form and in design mode, but combo does not show the apropiated value. Any idea?
>>>Carlos.
>>
>>Combo.BoundTo=.T.
>>Combo.ControlSource=""
>
>I have this two properties setted in design mode. Anyway i've tried to setting them in init event of the form without success. Have you try it with a negative value ?
>
>Combo.BoundTo=.T.
>Combo.ControlSource=""
>combo.addlistitem("a", 0, 1)
>combo.addlistitem("1", 0, 2)
>combo.addlistitem("b", 1, 1)
>combo.addlistitem("b", 1, 2)
>combo.addlistitem("c", -1, 1)
>combo.addlistitem("c", -1, 2)
>
>combo.value = -1
>
>this is a sample and doesn't works. If you select interativelly yes, but in init code dont.

Sorry, it's bad sample. If you want to have two column and let say negative value in second column, then code should look like:
*** combo init event
this.addlistitem("a", 1, 1)
this.addlistitem("-1", 1, 2)
this.addlistitem("b", 2, 1)
this.addlistitem("2", 2, 2)
this.addlistitem("c", 3, 1)
this.addlistitem("-3", 3, 2)

Now to 'initiate' the combo you can issue Combo.Value="-3" to get 'c' in text portion of the combo.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform