Button.Visible = true has no effect

  • Thread starter Thread starter TWischmeier
  • Start date Start date
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.
 
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.
 
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?
 
Back
Top