2008-06-09, 10:53 PM
Ommina Wrote:My turn for some oddness!
I'm finding that, when changing the .Visible property of a label (presently from 'true' to 'false'), that the label is not actually being removed until some other UI event happens.
That is, a label starts of visible. I then set .Visible = false in code. Label remains visible on the screen.
But! If I move the focus, either within the button list, OR within the list view, OR between the button list and the list view, the label will vanish. Alternately, if the text property of some other label (in my case, the current time) changes, the label will vanish then too.
As a workaround, I can just set the text property to String.Empty and the DrawImage to an empty bitmap, so it isn't a really big deal. But thought I'd throw it out there anyway!
I do something like that in my code and it seems to work ok
ctlMgr.setFocus(cmdButtonList);//set to something that is visible and enabled.
[SIZE=2]button1.Visible = false;
button1.Enabled = false;
button1.Text = [/SIZE]"Disabled";//legacy - used to just leave it disabled and visible
It moves off of the disabled button and makes it invisible.
I had some trouble with this initially and this ended up working.