How do I call another winform using c++winform?

keke wang 0 Reputation points
2023-03-23T01:52:04.49+00:00

I have a winform program now written in C++that seems different from the winform I used before. How do I use it to call another winform?

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,693 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. YujianYao-MSFT 4,281 Reputation points Microsoft Vendor
    2023-03-23T01:56:50.8633333+00:00

    Hi keke wang,

    I guess you are creating a CLR project, you need to create two winforms, and include the header files of the subwindows in the main window code, you can refer to the following code:

      #include"MyForm1.h"
      MyForm1 ^ dlg = gcnew  MyForm1();  
      dlg->Show();  
    

    In this example I am using a button to trigger the event.

    Best regards,

    Elya


    If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".

    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.

    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.