Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Accessing a Form's Controls from another Class

0 views
Skip to first unread message

ZMeister

unread,
Jun 20, 2002, 1:50:27 AM6/20/02
to
I have a form that creates an instance of a class that processes some data
when a button is pushed on the form. In this class that processes the data
I would like to update a listbox on the form. I cannot figure out how to
get a hold of the listbox to add items. I have changed the listbox to
public... I can get the listbox in the form button_click handler but not in
the class that it creates.

What can I do about this.??

Thanks, ZMeister.


Armin Zingler

unread,
Jun 20, 2002, 4:28:29 AM6/20/02
to
"ZMeister" <...> schrieb

It's good design not to reference a UI element, like a form, from a class.
In the class, you can raise an event. The form should handle the event and
update the listbox with the data given by the event parameters.

Armin

0 new messages