Programically added new form with button - Click even't doesn't see textbox

Discussion in 'Visual Basic .NET' started by simpleonline1234, Jun 26, 2012.

  1. simpleonline1234

    simpleonline1234 Junior Member

    Jan 26, 2010
    Likes Received:
    I have created my new window, textbox, and button and I can have my button display a"Hello") when I set the code under the click event.

    My Window has a button and a textbox.

    My issue is when I try to reference my new window's textbox in the code under that click event that I get an error message stating my new window is not declared.

    How do you get around that? The code is going to create the new window, the button, and the textbox and then I am trying to have the coded added to the button at runtime but because it doesn't exist yet it's firing an error when I try to build it.

    I tried adding the addeventhandler after the windows was created in the code but still a no go.
  2. theMagicNumber

    theMagicNumber Regular Member

    May 13, 2010
    Likes Received:
    Send the code i will help you with that.