CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: MDI Forms

  1. #1
    Join Date
    Aug 2000
    Posts
    9

    MDI Forms

    I am using a MDI form with abt 35-40 child forms.
    Now, is there any way in which i can cycle thru all the child forms in a MDI?..just like we do for cyclin thru all the controls in a form..for example

    for Each ctl In Controls
    If TypeOf ctl is ComboBox Or TypeOf ctl is TextBox then
    If ctl.Text = "" then
    nullcheck = 1
    ' MsgBox "empty field not allowed" + ctl.Name
    Exit Function
    End If
    End If
    next



    similary do we have anythin by which we can cycle thru all the forms?..pls reply asap..
    I am aware that we can cycle thru all the ActiveForms in the MDI using the ActiveForm property...but i want to cycle thru all the forms irrespective of whether its active or not..
    thanx



  2. #2
    Join Date
    Sep 1999
    Location
    Red Wing, MN USA
    Posts
    312

    Re: MDI Forms

    You can use the Forms collection, but the Forms do have to be loadedrivate Sub Command1_Click()
    Dim oForm as Form
    for Each oForm In Forms
    If Not TypeOf oForm is MDIForm then
    If oForm.MDIChild then oForm.Caption = ""
    End If
    next
    End Sub



    Aaron Young
    Analyst Programmer
    [email protected]
    Certified AllExperts Expert: http://www.allexperts.com/displayExp...p?Expert=11884
    Aaron Young
    Senior Programmer Analyst (Red Wing Software)
    Certified AllExperts Expert

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

Featured