CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Help!

  1. #1
    Join Date
    May 2001
    Posts
    155

    Help!

    i have a program, that when you click on a command button it takes the text from 2 different textboxes in 2 different forms and combines them into 1 richtextbox on another form. so far i have a code like this:


    Dim f as Form7
    set f = new Form7
    f.richtextbox1.text = form3.richtextbox1.text & form4.richtextbox`.text
    f.show



    I also have a command that creates a new form
    The problem is when i click on the button, it creates a new form, but it doesn't
    combine the 2 text boxes and put the text in the new textbox in the form.
    What's wrong??


    --Ant
    --------------------------------------------------
    check out my newest freeware
    E-mail me at: [email protected]
    for the address

  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Help!

    I tried your sample with no problems. Created a 2 form project (Form1 and Form2) added Richtextboxes to both. added this code to Form1
    The data from Both richtextboxes showed on form "N"
    ' code from Form1

    option Explicit

    private Sub Command1_Click()
    Dim n as Form1
    set n = new Form1
    n.RichTextBox1 = Form1.RichTextBox1.Text & Form2.RichTextBox1.Text
    n.Show
    End Sub

    private Sub Form_Unload(Cancel as Integer)
    Dim f as Form
    for Each f In Forms
    Unload f
    next f
    End Sub




    John G

  3. #3
    Join Date
    May 2001
    Posts
    155

    Re: Help!

    But the forms are MDI Forms

    --Ant
    --------------------------------------------------
    check out my newest freeware
    E-mail me at: [email protected]
    for the address

  4. #4
    Join Date
    May 2001
    Posts
    155

    Re: Help!

    But the forms are MDI child Forms

    --Ant
    --------------------------------------------------
    check out my newest freeware
    E-mail me at: [email protected]
    for the address

  5. #5
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Help!

    Should not make any difference but I will try that and see if there is a problem.

    John G

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

Featured