Results 1 to 8 of 8

Thread: Hmmmm CONFUSED!

  1. #1

    Thread Starter
    Addicted Member Stick's Avatar
    Join Date
    Aug 1999
    Location
    Iowa
    Posts
    152

    Question Hmmmm CONFUSED!

    Dim X As New frmFORM1()
    X.txtTEXTBOXONE.Text = "TEST"




    i have this on one form called frmFORM2 why does it not send the text to frmFORM2 ?


    Can anyone help


    Thanks

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: Hmmmm CONFUSED!

    Originally posted by Stick
    Dim X As New frmFORM1()
    X.txtTEXTBOXONE.Text = "TEST"




    i have this on one form called frmFORM2 why does it not send the text to frmFORM2 ?


    Can anyone help


    Thanks
    what are you doing exactly? so you have two open forms and you're trying to change the text of a textbox on another form? Umm you have to have a refrence to the other form, you cant just declare a new variable.

    search the forum if that's what you want to do... a few billion people including me have asked this before
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Addicted Member Stick's Avatar
    Join Date
    Aug 1999
    Location
    Iowa
    Posts
    152

    i did reference it

    Dim X As New frmFORM1
    then i call the textbox
    X.txtTEXTBOXONE.Text = "TEST"
    this code it one the frmForm2

    Thanks

  4. #4
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780
    You still have not explained it very well.

    But your code has nothing to do with frmForm2, you have no references to it at all.

    e.g

    ' Create a new instance of frmForm1
    Dim X As New frmFORM1

    'Put the text "TEST" into the textbox on the new instance of frmForm1
    X.txtTEXTBOXONE.Text = "TEST"


    You have to remember the BIG fact that everything in VB.net has to be a instance of an object. You might want to have a good read on the differences between vb6 and vb.net.

  5. #5
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    if frmFORM1 is already open then your code wont work cause you create and work with a new isntance if it, not the one which is open. If not open then when u open it txtTEXTBOXONE.Text value should be the one you specified here.
    Last edited by Lunatic3; Apr 11th, 2003 at 07:34 AM.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  6. #6

    Thread Starter
    Addicted Member Stick's Avatar
    Join Date
    Aug 1999
    Location
    Iowa
    Posts
    152

    Makes sense Thanks

    Hey that makes sense thanks alot

  7. #7

    Thread Starter
    Addicted Member Stick's Avatar
    Join Date
    Aug 1999
    Location
    Iowa
    Posts
    152

    is there anyway to change a text box

    Is there anyway to change a textbox on one form from another form while they are both open?


    Thanks

  8. #8
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    Yes,

    Refere to the third reply of this thread:
    http://www.vbforums.com/showthread.p...a+across+forms
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

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