| |

VerySource

 Forgot password?
 Register
Search
View: 810|Reply: 3

Open one Form window and close another

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-21 16:40:01
| Show all posts |Read mode
Open one Form window and close the other (C #);
For example: a login window, after login, the login window closes, and another window opens!
Please advise!

It is closed, not with this.Hide (); !! !!
Reply

Use magic Report

0

Threads

52

Posts

34.00

Credits

Newbie

Rank: 1

Credits
34.00

 China

Post time: 2020-1-31 06:54:02
| Show all posts
I usually write the startup form directly as an exe
Then call the main program's exe in the startup form and close itself at the same time
Reply

Use magic Report

0

Threads

16

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

Post time: 2020-1-31 08:36:01
| Show all posts
I do it
Create a NewForm in the FormLoad of the MainForm, complete the verification process in the NewForm, and then dispose the NewForm. At this time, the MainForm continues to execute and just displays.
Reply

Use magic Report

1

Threads

16

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-2-1 05:54:01
| Show all posts
Use multi-threaded operation.
Introducing namespaces
Imports System.Threading

Write a method
    Private Sub FormStart ()
        Application.Run (New NewForm) '* Run a new program window
    End Sub

Then write the following statement under the button of your LoginForm
  Dim thread As New Thread (New ThreadStart (AddressOf FormStart)) '* Define a new thread to open the form
  thread.Start ()
   Application.Exit () '* Close the login form


All the above code is written in LoginForm
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list