登陆方式设计
方式 设计 登陆
2023-09-14 08:57:11 时间
1.
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 program Project1; 2 3 uses 4 Vcl.Forms, 5 Unit1 in 'Unit1.pas' {Form1}, 6 Unit2 in 'Unit2.pas' {Form2}; 7 8 {$R *.res} 9 10 begin 11 Application.Initialize; 12 Application.MainFormOnTaskbar := True; 13 if Login() then 14 Application.CreateForm(TForm1, Form1); 15 Form1.Caption := '登录成功'; 16 Application.Run; 17 end.
2.
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 unit Unit2; 2 3 interface 4 5 uses 6 Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; 8 9 type 10 TForm2 = class(TForm) 11 Button1: TButton; 12 procedure Button1Click(Sender: TObject); 13 private 14 { Private declarations } 15 public 16 { Public declarations } 17 end; 18 function Login():Boolean; //方法声明 19 var 20 Form2: TForm2; 21 22 implementation 23 uses Unit1; 24 {$R *.dfm} 25 26 function Login():Boolean; //方法定义 27 var 28 FormLogin:TForm2; 29 begin 30 // FormLogin:=TForm2.Create(nil); 31 Application.CreateForm(TForm2, FormLogin); 32 // FormLogin:=TForm2.Create(Application); 33 Result := FormLogin.ShowModal = mrOk; 34 FormLogin.Free; 35 end; 36 37 procedure TForm2.Button1Click(Sender: TObject); 38 begin 39 ModalResult:=mrOK; 40 end; 41 42 end.
3.
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 unit Unit1; 2 3 interface 4 5 uses 6 Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls; 8 9 type 10 TForm1 = class(TForm) 11 Button1: TButton; 12 Panel1: TPanel; 13 procedure Button1Click(Sender: TObject); 14 private 15 { Private declarations } 16 public 17 { Public declarations } 18 end; 19 20 var 21 Form1: TForm1; 22 23 implementation 24 uses Unit2; 25 {$R *.dfm} 26 27 procedure TForm1.Button1Click(Sender: TObject); 28 begin 29 Caption := 30 Application.MainForm.Name; 31 end; 32 33 end.
相关文章
- 绘制方式和OpenGL枚举对应关系
- 【JAVA】String中两种初始化方式比较
- 实现ABAP条件断点的三种方式
- Database之SQLSever:数据管理学习之使用备份向导、SQL命令、导出数据三种方式对已建立的数据库进行备份图文教程之详细攻略
- 【K3s】第27篇 部署dashboard时不同k3s版本获取token的方式
- extjs grid 复制问题还有一种解决方式.
- MyBatis 源代码阅读笔记 2 基于"注解"方式的代码编写
- 文件内容拷贝(1)文本方式-逐个字符拷贝(2)文本方式--逐行拷贝(3)二进制方式--逐块拷贝 (4)二进制方式-一次性拷贝
- 华为运营商级路由器配置示例 | 配置静态方式VPLS示例
- 一文读懂14种 UML 图业务建模&系统分析的设计方式(上)
- 数字IC设计 - 逻辑综合简介与Design Compiler使用(GUI方式)
- Gradle 任务访问文件的几种方式
- 【MySQL笔记】Windows采用压缩包方式安装MySQL数据库服务
- Harbor高可用集群设计及部署(基于离线安装方式)