Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Add Event to the referenced form in VB.net

Posted on 2004-11-17
1
Medium Priority
?
312 Views
Last Modified: 2010-04-24
I have one form in the vb.net application(client) that has been referenced from the class library.  I like to add event like button_clicked on the referenced form.  How to add the events of forms and control of forms in the client application if the form is not added manually but is referenced from another class library.
0
Comment
Question by:tgatif
1 Comment
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1200 total points
ID: 12608929
The easy way is to:

(1) Define an event in the form:
     Public ButtonClickedEvent(sender As Object, e As EventArgs)

(2) Raise the event:
     RaiseEvent ButtonClickedEvent(Me, New EventArgs)

(3) Catch the event:
     Private WithEvents formReference as frmMain

    Private Sub formReference_ButtonClickedEvent(sender As Object, e As EventArgs)
    End Sub

Bob
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Loops Section Overview
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question