Results 1 to 7 of 7

Thread: [RESOLVED] MDI forms and custom properties problem

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    4

    Resolved [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.

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: MDI forms and custom properties problem

    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.

  3. #3
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: MDI forms and custom properties problem

    Quote Originally Posted by alfredspacey
    ...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).

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    4

    Re: MDI forms and custom properties problem

    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.
    Attached Files Attached Files

  5. #5
    Hyperactive Member
    Join Date
    Feb 2003
    Location
    Grenada
    Posts
    346

    Re: MDI forms and custom properties problem

    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.

  6. #6

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    4

    Re: MDI forms and custom properties problem

    Thanks alot Protocol, problem solved.

  7. #7
    Hyperactive Member
    Join Date
    Feb 2003
    Location
    Grenada
    Posts
    346

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width