Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Handlers With Controls In Another Form

Status
Not open for further replies.

0CODE

Programmer
Feb 8, 2004
63
CA
I have a procedure which basically combines multiple handlers of many textboxes. Now the problem is I would like to add more handlers but these ones are from controls on a different form and it will not work by doing for ex:
handles otherform.textbox3.click - it says you need a withevents but that doesn't help me much. What are some of the ways i can do this (not the creating of a new class? any comments, tips etc. will be appreciated.

thanks
 
Try placing the subroutine that handles the textboxes into a separate module and call it public. Then do your AddHandler statement as usuall. Then it shouldn't matter which form it is on and it should work.

Another option is to create another module and declare your form with the subroutine as global. The subroutine still has to be public, but then you can use the global name for the form (after instatiation) with the dot notation for access to the subroutine in your AddHandler statement.
 
ya thanks guys, the addhandler just didn't cross my mind even though i knew about it.

thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top