Results 1 to 12 of 12

Thread: MDIForm

  1. #1

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407

    Talking MDIForm

    ok...i have a MDIForm with a regular form inside of it..now when i click New i want it to come up with the same form1 over again..like in MSWord when you click new..and a new document comes up over and over and over again? yeah...anyone understand this post at all?

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Use this code for the New thing in your MDI form
    VB Code:
    1. Private Sub mnuNew_Click()
    2.  
    3.     Static lDocumentCount As Long
    4.     Dim frmD As Form1
    5.     lDocumentCount = lDocumentCount + 1
    6.     Set frmD = New Form1
    7.     frmD.Caption = "Document " & lDocumentCount
    8.     frmD.Show
    9.  
    10. End Sub

  3. #3

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    Ok that worked but...when i clicked new..it came up with the form1 and then another window with Document 1....how would i fix it?

  4. #4
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    You must have screwed up elsewhere because on it's own it works fine...

    Attached Images Attached Images  

  5. #5

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    send me that program you made..i'll check what i did....

  6. #6
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Ah! I didn't save it...hang on have to build it again.
    A "please" wouldn't go amiss either!

  7. #7
    Addicted Member
    Join Date
    May 2001
    Location
    Québec, Canada
    Posts
    131
    Did you put the frmD MDIChild property to true? If no, this maybe your problems.
    Khavoerm Irithyl

  8. #8
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Here:
    Attached Files Attached Files

  9. #9

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    Oh..oops..lol sorry..i was kinda rushing and crap..here..if this will make you happy..

    Can i please please pleaaaaase have that program you made?

    ok...well since it's here..thanks..i'll check it out.

  10. #10
    Addicted Member
    Join Date
    May 2001
    Location
    Québec, Canada
    Posts
    131
    It works well on my computer
    Khavoerm Irithyl

  11. #11

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    ohhh i found the problem..look..this is what i did....now i need help again..

    VB Code:
    1. 'this is for Form1 (the MDIChild)
    2. Private Sub Form_Resize()
    3.     RichTextBox1.Width = Form1.Width - 100
    4.     RichTextBox1.Height = Form1.Height - 400
    5. End Sub

    and every time it does that..it brings up this.....
    Attached Images Attached Images  

  12. #12
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Try this instead. You can't reference Form1 directly anymore.
    VB Code:
    1. Private Sub Form_Resize()
    2.  
    3. RichTextBox1.Width = Me.ScaleWidth - 120
    4. RichTextBox1.Height = Me.ScaleHeight - 120
    5.  
    6. End Sub

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