Hello all! I'm a year one programming student who is currently finishing up his first year, and heading into AP! We only really work with VB in our corse, and we're not moving too fast, so I had a question I'd hope was answerable. Is it possable to cause a command button to become invalid, that is, grey it out so that the button cannot be used until a certian value = true?

Recommended Answers

All 3 Replies

Accually I guess you can go on and deleat this, I found a way to use it doing the cmdButton.Visible command--unless theres another way to go about what I was after, that is.

command1.enabled = false ?

I agree with comatose, in the properties window of the command button there is a property name "Enabled" set this to what you want the button on startup, and then when in the form the code you need, as stated above is simply command1.enabled = false, then you will still see the command button but it will be "greyed out" as you put it.
hope this helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.