• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 405
  • Last Modified:

Need Help Invoking A Load Handler Programmatically in Visual Stutio .NET using Visual Basic


I am developing a VB.NET PC application using Visual Studio 2008 with the .NET 3.5 Framework.

My code pops a dialog box, which has code attached to the dialog's Load event.

I have a button on the dialog whose handler performs some preliminary operations to clear most of the controls on the dialog, and then needs to rerun the dialog's Load handler.  Can anyone tell me what syntax to use to re-invoke the dialog's Load handler subroutine?  I've tried various syntax combinations, but none will compile.

If this is impossible, I could copy/paste the code in the dialog's Load handler subroutine into the handler for the button, but this is not an attractive option as the code is long and it would be nice to just have it one place (i.e., so updates don't have to made twice).

Thanks, Stu Engelman
  • 2
1 Solution
Luis PérezSoftware Architect in .NetCommented:
Have you tried this?

Call myDialogName_Load(Nothing, Nothing)

Hope that helps.
stuengelmanAuthor Commented:

Thank you!!!!  It works.

You're the best, Stu
stuengelmanAuthor Commented:
Great job - fast and accurate.  A+++++
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now