为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

弹出信息框

2017-12-12 4页 doc 15KB 16阅读

用户头像

is_153723

暂无简介

举报
弹出信息框弹出信息框 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TFloatWnd = class(TForm) private procedure WMActivate(var Message: TWMActivate); message WM_ACTIV ATE; procedure FormClose(S...
弹出信息框
弹出信息框 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TFloatWnd = class(TForm) private procedure WMActivate(var Message: TWMActivate); message WM_ACTIV ATE; procedure FormClose(Sender: TObject; var Action: TCloseAction); public constructor CreateEx(AOwner: TComponent; CFrame: TWinControlClass); procedure ShowAt(X, Y: Integer); end; TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } procedure WMActivate(var Message: TWMActivate); message WM_ACTIV ATE; end; var Form1: TForm1; implementation uses Unit2; {$R *.dfm} { TFloatWnd } constructor TFloatWnd.CreateEx(AOwner: TComponent; CFrame: TWinControlClass); begin inherited CreateNew(AOwner); AutoSize := True; FormStyle := fsStayOnTop; BorderStyle := bsToolWindow; with CFrame.Create(self) do Parent := Self; OnClose := FormClose; end; procedure TFloatWnd.FormClose(Sender: TObject; var Action: TCloseAction); begin Action := caFree; end; procedure TFloatWnd.ShowAt(X, Y: Integer); begin Left := X; Top := Y; Show; end; procedure TFloatWnd.WMActivate(var Message: TWMActivate); var i: Integer; begin for i := 0 to Screen.FormCount - 1 do if Screen.Forms[i].Handle <> Handle then SendMessage(Screen.Forms[i].Handle, WM_NCACTIVATE, Ord(Message.Active <> WA_INACTIVE), 0); end; procedure TForm1.Button1Click(Sender: TObject); var FloatWnd: TFloatWnd; begin FloatWnd := TFloatWnd.CreateEx(Self, TFrame2); FloatWnd.ShowAt(Left + 10, Top + 20); end; procedure TForm1.WMActivate(var Message: TWMActivate); var i: Integer; begin for i := 0 to Screen.FormCount - 1 do if Screen.Forms[i].Handle <> Handle then SendMessage(Screen.Forms[i].Handle, WM_NCACTIVATE, Ord(Message.Active <> WA_INACTIVE), 0); end; end.
/
本文档为【弹出信息框】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索