Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control of three options
Message
From
06/07/2011 10:53:18
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01517424
Message ID:
01517430
Views:
124
This message has been marked as the solution to the initial question of the thread.
(1) I think there are 8 possibilities - from 0 to 7
shift1 = 2 ^0
shift2 = 2^1
shift3 = 2^ 2


(2) I'm afraid you'll have to use a container with 3 option buttons

(3) Add an unvisible spinner to the container (range 0-7) and set the controlSource of the spinner to the field

(4) add code to the container
- refresh = setting the options on/off (easy with bittest(field, 0) , bittest(field, 1) , bittest(field, 2)

(5) add code to the optionbuttons (interactive change) to set the value of the spinner accordingly

_

>Hi,
>
>I need to create a control that will have 3 choices kind of similar to how the option group control works but use should be able to select more than 1 choice. For example:
>
>Shift 1 [ ] Shift 2 [ ] Shift 3 [ ]
>
>The control should be bound to one field, of Int type. So that the value stored in the field would be as following:
>0 - if user didn't make any selection
>1 - If user selected Shift 1
>2 - Shift2
>3 - Shift1 + Shift2
>4 - Shift1 + Shift3
>5 - Shift2 + Shift3
>6 - Shift1 + Shift2 + Shift3
>
>The only way I can think of is by creating a container-based class with three optio control buttons.
>
>But, in case I am missing something, is there a way to use one native VFP control for this?
>
>TIA.
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform