B
BobRoyAce
I am trying to understand Enter and Leave events for a user control. I
am using Visual Studio 2005, using VB, for a Windows Forms application.
I am showing and hiding (by changing visible property) user controls on
my main form (within a panel) based on NavBar links being clicked on. I
put code in the Enter and Leave events to simply show a message. Here's
what happens...
The first time the contol is shown, the Enter event fires.
The first time I click on another NavBarItem, the Leave event fires.
However, the control associated with the clicked on NavBarItem doesn't
show.
After that, the Enter and Leave events no longer fire when control's
visibility is changed.
So, I guess it's not the change in visibility that fires these events.
Then what does cause them to fire?
What if I want to check for certain conditions being met before I allow
a user control to be hidden (Visible=False) and, if they're not met, I
disallow the change (i.e. keep it visible and don't show the new user
control)?
am using Visual Studio 2005, using VB, for a Windows Forms application.
I am showing and hiding (by changing visible property) user controls on
my main form (within a panel) based on NavBar links being clicked on. I
put code in the Enter and Leave events to simply show a message. Here's
what happens...
The first time the contol is shown, the Enter event fires.
The first time I click on another NavBarItem, the Leave event fires.
However, the control associated with the clicked on NavBarItem doesn't
show.
After that, the Enter and Leave events no longer fire when control's
visibility is changed.
So, I guess it's not the change in visibility that fires these events.
Then what does cause them to fire?
What if I want to check for certain conditions being met before I allow
a user control to be hidden (Visible=False) and, if they're not met, I
disallow the change (i.e. keep it visible and don't show the new user
control)?