TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Christopher
NA
1
0
Handling buttons events from a module.
Jun 8 2006 7:49 PM
Hello, I was wondering there wasy any way to use button events outside of the form that holds the button (in this case, inside a module). For example, if I had a window called Form1 which contained a button called Button1, and I wanted to use the following inside a module: Private Sub Button1_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Button1.Click ' Button handling stuff here. End Sub ...I would receive the error: "Handles clause requires a WithEvents variable defined in the containing type or one of its base types." (Which, as I'm relatively new to Visual Basic, is basically gibberish to me. =P) Am I to assume then that button events can only be put in the form that contains them? Or is there some way to reference events for a button on another form? Thanks very much in advance. =)
Reply
Answers (
0
)
Accessing other programs
UNC Path Problem in Windows Services in .NET