[RESOLVED] MDI forms and custom properties problem
I created a custom property to get the string from a certain textbox and then called it from another form.
eg.
*In form2
Public Property Get textinbox() As String
textinbox = Text1.text
End Property
*In form 1
tempstring = form2.textinbox()
When form2 is MDI the form loads and is shown, but when the form is not MDI it is only initilized . As I need the form to be MDI, what can I do to stop the MDI form from showing when I query it with a custom property.
Try storing Text1.Text input in a module level variable (use the validate event) and change the property get to retrieve from this module level variable instead of the textbox.text property directly.
If that doesn't work then you'll have to store the info in a bas module public variable.
...When form2 is MDI the form loads and is shown, but when the form is not MDI it is only initilized . ...
Sorry, but it doesn't sound right - you must be doing something else (perhaps on the MDI form directly) to trigger Form2 to show up.
Thing is that custom properties are stored in a different name space so parent object only gets initialized (since it's being referenced) but not loaded regardless of interface (MDI or not).
Firstly thanks for the replies. I might very well be doing something wrong so I'v attached a small program which uses custom properties to read a textbox from an MDI form and a conventional form. In the propram the the MDI form is shown when it's textbox is queried but the normal form is not shown. I'm hoping someone can tell me how to fix this.
In the MDI Form Property, set AutoShowChildren to false.
In your sample, it is set as True, so any reference to any object placed on a child form will automatically show it....
This will stop the form from auto-showing...
If my post has been helpful, then please rate it accordingly...
If it has solved your question(s), then don't forget to mark the thread as "[Resolved]"... thank you.
Re: [RESOLVED] MDI forms and custom properties problem
Glad to help...
If my post has been helpful, then please rate it accordingly...
If it has solved your question(s), then don't forget to mark the thread as "[Resolved]"... thank you.