VB.Net vs VBA: Are there equivalent functions to UserForm_Initialize, etc.?

Giacomo Raucci 346 Reputation points
2023-06-16T21:17:44.0533333+00:00

I'm converting a VBA application to VB.NET; however, I can't find the equivalent methods to VBA's UserForm_Initialize, UserForm_Activate, UserForm_QueryClose, etc. Where can I look to find the respective methods for VB.NET, assuming they exist?

Developer technologies | VB
Developer technologies | Visual Studio | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Castorix31 90,681 Reputation points
    2023-06-17T06:09:25.2766667+00:00
    0 comments No comments

  2. Jiachen Li-MSFT 34,221 Reputation points Microsoft External Staff
    2023-06-21T08:20:21.2566667+00:00

    Hi @Giacomo Raucci ,

    Referring to the Order of Events in Windows Forms, you can use the following events and methods to handle similar functionality.

    UserForm_InitializeForm.Load

    UserForm_ActivateForm.Activated

    UserForm_QueryCloseForm.FormClosing

    Best Regards.

    Jiachen Li


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. Giacomo Raucci 346 Reputation points
    2023-06-22T19:44:31.03+00:00

    See final comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.