newbie question

Hi,

I have an extreem newbie question

I have made a textbox and a button, when I push the button I want to fill the textbox with text.

This is what happens when I push the button

txtbox1.Text = "Test"

but when I do this it comes with an error that the object txbox1 does not excist, withs is strange becouse its really the name.

please help



Answer this question

newbie question

  • sebus

    the problem is one of referencing the containership.

    You put these two objects (controls) in a form. I assume you put the code in the button's Click() method.

    The Button's method does not know where to find the textbox.

    Reference it this way:

    ThisForm.txtbox1.value = "Test"

     

    ThisForm refers to the containing form. This refers to the object you are dealing with (like Me in VB)

    Note: in VFP we use the Value property for textboxes.

    HTH

     


  • Michael Lane

    It worked thnx
  • newbie question