Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Is there a way I can access another form's objects or instances without passing them through a function or sub routien? Here's my situation.

 

I have a frmMain form that contains all my objects: buttons, panels, text boxes, datagrid, dataset and dataadapter etc.. Then I added a another class component, clsEvent, to my project. In this class, I want to be able to access all those objects in the frmMain form without passing them through a public shared sub. Is there a way? If there is way, mind give me a hand on this issue?

 

Any help is greatly appreciated!

 

ljCharlie

  • *Experts*
Posted
You need the instance of the form that you want to access the control from. That would be very simple to achieve. Simply in your class' contructor add one argument to the list and when declaring that class simply pass in the from instance from that argument.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...