how wouild one go about increasing the title of a child form by one.
For example: Each time a user hits new and the default title is Document. The first one would be Document 1 and the next Document 2 and son.
Thanks,
Thegenesi
Printable View
how wouild one go about increasing the title of a child form by one.
For example: Each time a user hits new and the default title is Document. The first one would be Document 1 and the next Document 2 and son.
Thanks,
Thegenesi
Here you go ...
Thank you! That worked they way you had, but I am trying to have the open file in a module file using a With statment.
If i use the accumulator then it doesn't accumulate, just stays at the number initiazlied.
Sorry about the spelling.
I don't know about your code but the concept is :
declare a counter (as in the demo) and before showing the new form just attach that counter with it .Is this what you mean ?
Option Explicit OnQuote:
Originally posted by Pirate
I don't know about your code but the concept is :
declare a counter (as in the demo) and before showing the new form just attach that counter with it .Is this what you mean ?
Option Strict On
Module SharedCode
Friend fMdiParent As frnMdiParent
Friend Sub FileNew()
Dim pintFrmCounter As Integer = 0
Dim frmCurrent As New frmMdiChild()
With frmCurrent
.MdiParent = fMdiParent
pintFrmCounter += 1
.Text = "Machine " & pintFrmCounter
.Show()
End With
End Sub
End Module
Theirs the code, which as stands will open each new window with Machine 1, Machine 1, and so on
Try to declare this variable "pintFrmCounter" outside "FileNew()" sub
Any idea why?
Anyhow, whats the best way to say take the totals of third text boxes in third different child forms to display them in a fourth form?
I know it should work if at least nothing goes wrong ;) !
your code declares new variable with defalut value of "0" everytime you call the sub "FileNew" . So when you declare it outside the sub , it won't be affected how manytimes you call the sub . (I know how bad teach am I:p ) .
Yup it did any advice on adding the totals (see above post):D
Do you want to get values from Form3 to Form4 ?right ?:rolleyes:
Actually, I still have no idea on how to get the totals from a random number of open windows (the values in a text box), store that number as a friend value type and then display that total in a seperate standard form.
Sorry for being so newbish.
see the demo...
Actually i guess my noobish was really comming out, but i meant from three text boxes -- like txtMoneyTotals from each child form and then displays the totals of those in a seperate form
Actually i guess my noobish was really comming out, but i meant from three text boxes -- like txtMoneyTotals from each child form and then displays the totals of those in a seperate form
OK , this now should be what you're looking for !