How can dynamic controls access static controls?

  • Thread starter Thread starter Fred White
  • Start date Start date
F

Fred White

Hi, I have a desktop application that uses an array of dynamic
buttons in a class. I would like on button-click to change the text
in a static text box on the form. The problem is that that when I
click on the button, the code that runs is in the buttonarray class,
not in the form. From within the class I have no access to the static
controls that are also on the form.. Does anyone know how to get
around this?? thanks for you help
 
there is probably an other way to do this but this should work

declare your form as a public shared var of that form
now you'll have access to the formvar.textbox

hope it helps

eric
 
* (e-mail address removed) (Fred White) scripsit:
Hi, I have a desktop application that uses an array of dynamic
buttons in a class. I would like on button-click to change the text
in a static text box on the form.

What is a "static text box"?
 
* "Cor said:
I wished I could answer it for you, but I think it is something as a label.

Or the OP is referring to a variable marked as 'Static'. I don't know.
 
in a static text box on the form. The problem is that that when I
click on the button, the code that runs is in the buttonarray class,
not in the form. From within the class I have no access to the static

Is the buttonarray instantiated in the form? If so, you need to pass a
reference to the form into the buttonarray. Perhaps you can overload the
buttonarray's constructor to take a reference to the form. Then the button
array would be able to access the form's properties.
 
Back
Top