Home All Groups Group Topic Archive Search About

If else and what ever :( (Newbie)

Author
2 May 2007 7:34 AM
5070707
Hi all!
Well, here is somewhat a newbie question that im sure a lot of people
will know how to answer!
i have a simple form in a windows application i created using VS2005.
(visual basic)
in that form i created two check boxes.
what im trying to do is:
when a user click the first one - then a predefined field will open
for him to fill.
when a user click the 2nd one - other set of predefined fields will be
open while the other ones stay diabled.

and vice versa.

could anyone send me a sample code of how to do this so i can use it
on my own app?

Cheers!!

50.

Author
2 May 2007 8:54 AM
Robin Tucker
Hi 5070707,


To simplify things, what you need is a method called "DisableAll".  This
method disables all of the fields on the form (myfield.Enabled = False).
Then you handle the "Click" message of either check box, calling
"DisableAll" in the handler and then making the field you want enabled,
enabled (myfield.Enabled = True)


Robin
Author
2 May 2007 9:24 AM
Andrew Morton
5070***@gmail.com wrote:
> in that form i created two check boxes.
> what im trying to do is:
> when a user click the first one - then a predefined field will open
> for him to fill.
> when a user click the 2nd one - other set of predefined fields will be
> open while the other ones stay diabled.
>
> and vice versa.

That sounds like you want radio buttons (mutually exclusive) rather than
checkboxes (more than one can be checked) in the UI.

Andrew