PDA

Click to See Complete Forum and Search --> : Opening a form within a MIDI form an infanate amount of times


Men.Shen
Jan 23rd, 2000, 08:25 AM
Hello,
I am stumped right here at this point since this is my first time using a MIDI form setup.

My question is: How would I open the same form within a MIDI form an infanate amount of times, and on each new opening the form caption would change accordingly (ie.) Untitled 1, Untitled 2, Untitled 3.

Thank you for who answers


------------------
- M e n S h e n
Canabatech Programmer

Homepage http://influx.virtualave.net
Email essex@seedesigns.com
ICQ 17527422

chrisjk
Jan 23rd, 2000, 09:00 AM
Paste this into the declarations section of the MDI form

Private Sub LoadNewDoc()
Static lDocumentCount As Long
Dim frmD As frmFormName
lDocumentCount = lDocumentCount + 1
Set frmD = New FormName
frmD.Caption = "Untitled " & lDocumentCount
frmD.Show
End Sub


Then on the form_load event of the MDI form and wherever you want the user to be able to open a new document, place this


LoadNewDoc


regards,

------------------
- Chris
chris.kilhams@btinternet.com
If it ain't broke - don't fix it :)

Men.Shen
Jan 24th, 2000, 03:28 AM
Just as a matter of clarification, you sure do it the hard way.

Code:

-----

Dim frm As New Form1
Static x
x = x + 1
frm.Caption = "Untitled " & x
frm.Show[\i]

------------------
- M e n S h e n
[i]Canabatech Programmer

Homepage http://influx.virtualave.net
Email essex@seedesigns.com
ICQ 17527422

Men.Shen
Jan 24th, 2000, 03:28 AM
lol, guess I screwed up with the UBB code, ohh well.

------------------
- M e n S h e n
Canabatech Programmer

Homepage http://influx.virtualave.net
Email essex@seedesigns.com
ICQ 17527422