| |

VerySource

 Forgot password?
 Register
Search
View: 911|Reply: 6

Make MDI login window

[Copy link]

1

Threads

5

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-12-9 09:00:02
| Show all posts |Read mode
Novice question

I have a LognFrm form (normal form). . . There is also a MainFrm form (MDI main form)

When I am running, the LognFrm form appears first, and MainFrm appears after verifying the password

The code is:
The OK button in LognFrm (If the password is not verified first, click OK to enter)

Self.Hied;
Application.CreateFrom(TMainFrm,MainFrm);
MainFrm.show;

It is normal after entering, that is, when I close MainFrm, why can't I exit the entire program normally, there is still in the process. . I did not release the memory, I used a lot of commands, such as Free, etc., all of them were like this, and an error was reported. . Is it because I didn't use it together, so something went wrong? Please help me to see it. . . Thank you.
Reply

Use magic Report

0

Threads

53

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-12-9 16:45:01
| Show all posts
Your main form is no longer mainform, because you put Application.CreateFrom(TMainFrm,MainFrm);
Write to the back of the loginform, in this way, the loginForm is used as the main form, so what you close is the main form, not the main form loginform
Reply

Use magic Report

1

Threads

5

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-12-9 17:00:02
| Show all posts
How should I write?

My login was changed. . .
               Application.CreateForm(TMainFrm,MainFrm);
               Application.Run;
               Self.Hide;
Reply

Use magic Report

0

Threads

53

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-12-9 17:15:01
| Show all posts
You put Application.CreateForm(TLoginFrm,LoginFrm); into Application.CreateForm(TMainFrm,MainFrm);
Below. Add the following code before application.run:
if LoginFrm.ShowModal = mrOK then
//by
else Application.Terminate;
Reply

Use magic Report

1

Threads

5

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-12-9 17:30:01
| Show all posts
No, there are still problems. . .

I get the code out. . .

In Auto, only LognFrm and others are dynamically established. .

In the establishment event of LognFrm, I have this sentence:
LognFrm.ShowModal;

Then in the button clicked to enter:
What i wrote is
Application.CreateForm(TMainFrm,MainFrm);
Application.Run;
Self.Hide;

Other unchanged
Then you can enter, there is no problem, that is, an error was reported when it was closed. . .

There is another problem. There is a cancel button on LognFrm with Application.Terminate;
When the login form appears, if you don't click to enter, click Cancel will also report an error, the same error message will be reported. . .

stevevaiI don't know how I am going to change it, please help me see it, thank you, my head is big. . .
Reply

Use magic Report

1

Threads

5

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-12-9 17:45:01
| Show all posts
Thank you, upstairs. The problem is not logging in. I did it right, because I changed it to other projects and it was easy to use. It may be a problem with other codes. . . Thank you very much upstairs, thank you Ang. . .
Reply

Use magic Report

1

Threads

5

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-12-9 19:45:01
| Show all posts
It’s been a long time. My problem is that there is a missing header file, so if something goes wrong, I will always report some inexplicable problems.
When referencing a dynamic library, there is one sentence missing Sharemem
Ha ha. . .
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