I have a form with a button (cmdVendorSelectSystem) that toggles a list from a list of Vendors to a list of Systems.
During testing I kept the initial state of the .Visible property to true. The button worked as intended - the list switched its contents, and the caption changed from "Select Systems" to "Hide Systems".
Then, once I was happy with the working, I changed the default setting to False (ie hidden). Now, whenever I select a Vendor from the list, I want to set the state of the Visible property to true, so that the button can operate the way I want it to (it makes no sense to keep it visible unless a Vendor is being displayed). However, the code does not produce the right result, ie the button does not appear, even though the control itself reports the state of the Visible property as True! Reality does not agree with the state of the control for some reason.
If I keep it visible all the time, then it works as it is supposed to. It's only when I try and make the button come into view that it fails.
Any ideas?
Tony
PS In a try-anything-once mood I clicked on the place where the invisible button is located. mirabile dictu it worked! Even though nothing was visible, the list changed, and the button became visible once I changed the caption (see code below). I'll post this as an interim question, just in case anyone has any quick solutions, and I'll post back as I learn more.
Here's the code to load a vendor and make the button visible:
and here's the code that 'does the work'.![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Bookmarks