android按钮置于顶层,如何把按键显示在最顶层窗口上(屏幕最顶上)
[Delphi] 純文本查看 復(fù)制代碼unit Unit2;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs;
type
TForm2 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure MyMsg(var msg: TWMKeyDown); message WM_KEYDOWN;
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.FormCreate(Sender: TObject);
begin
Canvas.Font.Size := 24;
Canvas.Font.Style := [fsBold];
Canvas.Font.Color := clRed;
Canvas.Brush.Color := clWhite;
end;
procedure TForm2.MyMsg(var msg: TWMKeyDown);
var
buf: array[0..255] of Char;
rect: TRect;
str: string;
begin
{獲取}
GetKeyNameText(msg.KeyData, buf, Length(buf));
{畫出來}
str := buf;
rect := ClientRect;
Canvas.FillRect(rect);
Canvas.TextRect(rect, str, [tfSingleLine, tfCenter, tfVerticalCenter]);
inherited;
end;
end.
總結(jié)
以上是生活随笔為你收集整理的android按钮置于顶层,如何把按键显示在最顶层窗口上(屏幕最顶上)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 乌鲁木齐中海九号公馆是毛坯房还是精装修?
- 下一篇: 家用遮阳网安装两头高度需要坡度吗