If else and what ever :( (Newbie)

5

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.
 
R

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
 
A

Andrew Morton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top