创建一个有对话框功能的窗口
2009-12-22 19:25
225 查看
在Delphi中打开Demo工程,并为主窗体增加一个TButton控件,创建 Form2对话框的目的是:当单击这个按钮时,可以调出Form2对话框
双击Form1上的Button1按钮控件,在事件处理过程中加入以下程序
Form2.Show;
由于Form1窗体调用Form2窗体,所以必须在Form1的库单元程序中对引用Form2进行说明.
在Unit1的Uses后面加入Form2窗体的库单元名Unit2.
双击Form1上的Button1按钮控件,在事件处理过程中加入以下程序
Form2.Show;
由于Form1窗体调用Form2窗体,所以必须在Form1的库单元程序中对引用Form2进行说明.
在Unit1的Uses后面加入Form2窗体的库单元名Unit2.
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,Unit2; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin Form2.Show; end; end.
相关文章推荐
- JavaScript窗口功能指南之创建对话框
- JavaScript窗口功能指南之创建对话框
- JavaScript窗口功能指南之创建对话框
- win32sdk学习-创建一个对话框窗口
- MFC入门学习之控件(2)创建一个对话框窗口并在运行时显示
- JavaScript窗口功能指南之创建对话框
- JavaScript窗口功能指南之创建对话框
- JavaScript窗口功能指南之创建对话框
- 创建一个如下的窗体,并在窗体上放置colorDialog控件。实现功能:1)程序运行时,单击打开颜色对话框按钮,可选择颜色,并以所选颜色作为窗体背景色
- JavaScript窗口功能指南之创建对话框
- JavaScript窗口功能指南之创建对话框
- 第四篇 ANDROID窗口管理服务实现机制 窗口管理是ANDROID框架一个重要部分,主要包括如下功能: (1)Z-ordered的维护 (2)窗口的创建、销
- JavaScript窗口功能指南之创建对话框
- idea一个窗口创建多个maven项目
- java 创建一个窗口标签上设置图像
- c#中在DataGrid里创建一个弹出式窗口------可实现源代码
- 用SDL创建一个窗口
- [转载]Windows程序如何创建一个窗口。
- Qt学习之路(8): 创建一个对话框(下)