Results 1 to 15 of 15

Thread: Increasing the title of a child form by one.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2003
    Posts
    27

    Increasing the title of a child form by one.

    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

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: Increasing the title of a child form by one.

    Here you go ...
    Attached Files Attached Files

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2003
    Posts
    27
    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.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    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 ?

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Feb 2003
    Posts
    27
    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 Explicit On
    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

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Try to declare this variable "pintFrmCounter" outside "FileNew()" sub

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Feb 2003
    Posts
    27

    Woot! Thanks Man, that worked.

    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?

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: Woot! Thanks Man, that worked.

    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 ) .

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Feb 2003
    Posts
    27

    Wink

    Yup it did any advice on adding the totals (see above post)

  10. #10
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Do you want to get values from Form3 to Form4 ?right ?

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Feb 2003
    Posts
    27
    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.

  12. #12
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    see the demo...
    Attached Files Attached Files

  13. #13

    Thread Starter
    Junior Member
    Join Date
    Feb 2003
    Posts
    27
    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

  14. #14

    Thread Starter
    Junior Member
    Join Date
    Feb 2003
    Posts
    27
    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

  15. #15
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    OK , this now should be what you're looking for !
    Attached Files Attached Files

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