Button.Visible = true has no effect

T

TWischmeier

Hi,

I encountered a strange problem where setting button.Visible = true
has no effect. I can successfully get and set some other properties.

Even if I debug to the point where I set that value and do a quick
watch (Ctrl + Al+ Q) and execute those following two lines manually:
btn2.Visible = true
btn2.Visible

it shows btn2.Visible being false. There is another button next to
this one where it works without a problem. I cannot think of any
reason why this occurs, so I am glad for any help.
 
P

Paul G. Tobey [eMVP]

From what thread are you doing this? If it's from another thread, I wouldn't
be surprised if it didn't work.

It's also possible that an event handler for the button is getting called
when you change the visibility state and, in there, it's setting the state
back to False.

Those are the two things that occur to me, anyway.

Paul T.
 
B

badzio

Hi,

I encountered a strange problem where setting button.Visible = true
has no effect. I can successfully get and set some other properties.

Are you using standard controls or some 3rd party dll? Maybe
btn.refresh() helps?
 

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