| |

VerySource

 Forgot password?
 Register
Search
View: 779|Reply: 7

Help, ask the question of closing the window of the previous layer.

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Japan

Post time: 2020-2-14 21:30:01
| Show all posts |Read mode
When the program is running, a login window appears. When the login button is pressed, it jumps to another one. The Visible property of this login form is set to false. At this time, the problem came. When I closed the current form, the program could not end because the login form was still in memory. . . How do I close that login form? Thank you very much!
Reply

Use magic Report

0

Threads

119

Posts

67.00

Credits

Newbie

Rank: 1

Credits
67.00

 China

Post time: 2020-4-14 18:15:01
| Show all posts
If you press the login button, you should close the login window if you are successful, otherwise you can let the user try to log in again!
Reply

Use magic Report

0

Threads

16

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-4-14 19:15:01
| Show all posts
The best way for your program:
Add a sentence Applition.exit () when exiting the program;
Reply

Use magic Report

0

Threads

110

Posts

63.00

Credits

Newbie

Rank: 1

Credits
63.00

 China

Post time: 2020-4-14 21:15:01
| Show all posts
try ..

Application.Exit ();
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-4-15 11:15:02
| Show all posts
If you close the login form on the top floor, the entire program should also be closed.
Do you have a good way?

The closing event of writing a form can also be closed ~~
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 Unknown

Post time: 2020-4-15 13:45:02
| Show all posts
Application.Exit (); can be achieved.
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-4-15 21:00:01
| Show all posts
Application.Exit method
Each form represented by the OpenForms property will trigger the FormClosing event
Set the Cancel property of the FormClosingEventArgs parameter of the event to True to cancel the event.
Reply

Use magic Report

0

Threads

119

Posts

67.00

Credits

Newbie

Rank: 1

Credits
67.00

 China

Post time: 2020-4-15 23:15:01
| Show all posts
Rearrange the relationship of windows so that the login form is a variable of the main form, not the other way around!
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