Results 1 to 2 of 2

Thread: Save Problem with mdi child

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Texas
    Posts
    313

    Question

    Ok I am a mdi form and i have a menu, it will do commands like new, save, save as, open, and exit. I have the new command do this:

    'Make a new Code Window object
    Dim NewWindow As New FRMCode

    'Display the New code window object
    NewWindow.Show

    On the FRMCode form I have a Rich Text Box called CODE. How can I if I hit the Save menu button on my MDI form, tell it which mdi child to save?

  2. #2
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    This is something I just worked out in my little homemade browser. An easy way to do it is to use the MDI form's ActiveForm property:
    Code:
    'in the MDI form
    Private Sub mnuSave_Click()
       'a quick save example to save the text of CODE on on the currently active child window
       Open "c:\dummyfile.txt" For Output As #1
       Print #1, MDIForm.ActiveForm.CODE.Text
       Close #1
    End Sub
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

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