Verify if Form is opened
Hello! Welcome to more one tutorial. This time I will show to you how to determine if a specific Form is running. It´s syJ
How to crte a project in Visual Studio?
Exists many ways to crte a new project in VS. For example, when you open your VS program, in theStart Pageyou will see the optionNewProject ...
Start in the Form Design
For this tutorial we will need a two buttons. One is to verify if the specific form we want is opened or not. The other is to show that form (this second button is just to show you that this works fine). You can add the form manually by right-clicking theProject Name > Add > Forms. In this case I will erate a form at running time.
The …
Click,View > .This will open the .vbfile of the form.
Now, Click incomboboxthat is in the top, left side. SelectFormX(events)and in theComboboxin the top right side selectLoad. This will erate theLoad Event of the Form
PrivateSubForm1_Load(senderAsObject, eAsEventArgs)HandlesMe.Load
Next, do the same to the button. Select in the leftButton2and in the right sideClickor more simple do double-click in the button in the designer.
PrivateSubButton2_Click(senderAsObject, eAsEventArgs)HandlesButton2.Click
In an empty space (between the lines:
Now is time to test. Debug you project. Click the Button2 to open thefrm. Then click Button1 to see if is running or not. You will get this message “The form is running”
No comments:
Post a Comment