Results 1 to 4 of 4

Thread: mdi form problem.

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 1999
    Location
    Fremont, Ca, 94538
    Posts
    40

    Post

    Hello, I got a problem with MDI forms. When I load the child forms, they all work perfectly fine, but when i try to check for the window w/ same caption before actually load another form, sometimes, it pops up a blank window. Can anyone help me out?

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670

    Post

    When you are 'in' a child form you should always use the Me keyword and not the form name to work with the form's properties;

    Eg- if the form is called frmDocument;
    Use Me.Caption = "...."
    instead of frmDocument.Caption = "..."

    If you use the name of the form VB starts a new version of that form.

    Lookup ME in the help for more info.



    ------------------
    Mark "Buzby" Beeton
    VB Developer
    [email protected]



  3. #3
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    How are you checking for the Existence of another Window with the Same Caption?

    If you are referencing the Caption Property of all your Forms, you could be loading some without realizing it, try this instead:
    Code:
    Private Function CaptionExists(ByVal sCheckCaption As String) As Boolean
        Dim oFRM As Form
        For Each oFRM In Forms
            If oFRM.Caption = sCheckCaption Then
                CaptionExists = True
                Exit For
            End If
        Next
    End Function
    Usage: If CaptionExists("Form2") Then ..

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]


  4. #4

    Thread Starter
    Member
    Join Date
    Oct 1999
    Location
    Fremont, Ca, 94538
    Posts
    40

    Post

    Thank you for all your help.

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