A
awfigsk
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, AxCtrls, OleCtrls, VCF1, Chartfx3;
type
TForm1 = class(TForm)
Chartfx1: TChartfx;
procedure FormKeyDown(Sender: TObject
var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
procedure WMSysCommand(var Msg: TWMSysCommand);message WM_SYSCOMMAND;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WMSysCommand(var Msg: TWMSysCommand);
begin
if (Msg.CmdType=SC_MAXIMIZE) then
begin
SetWindowLong(Handle,GWL_STYLE,GetWindowLong(Handle,GWL_STYLE) and not WS_CAPTION);
self.WindowState:=wsMaximized;
end
else
DefaultHandler(Msg);
Application.ProcessMessages;
end;
procedure TForm1.FormKeyDown(Sender: TObject
var Key: Word;
Shift: TShiftState);
begin
if Key=VK_ESCAPE then
begin
showmessage('Ok');
SetWindowLong(Handle,GWL_STYLE,GetWindowLong(Handle,GWL_STYLE) or WS_CAPTION);
WindowState:=wsNormal;
end;
end;
end.
[red]我已将表单的KeyPreView设置为了True,并且chartfx1的align属性值为alClient,[/red]
如果我将Chartfx1控件换成Memo控件或其他含有onkeypress的事件的控件,当表单
全屏时,按ESC键,能将表单恢复.但如果换成如chartfx1和其他不含
有onKeypress,onKeydown等事件的控件时,当按ESC键就没有用.[red]请问各位大侠,有没有
其他的方法当表单上含有chartfx1时,并且chartfx1的align属性值为alClient,
表单全屏时,按ESC键能恢复窗口大小?[/red]谢谢!
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, AxCtrls, OleCtrls, VCF1, Chartfx3;
type
TForm1 = class(TForm)
Chartfx1: TChartfx;
procedure FormKeyDown(Sender: TObject
var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
procedure WMSysCommand(var Msg: TWMSysCommand);message WM_SYSCOMMAND;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WMSysCommand(var Msg: TWMSysCommand);
begin
if (Msg.CmdType=SC_MAXIMIZE) then
begin
SetWindowLong(Handle,GWL_STYLE,GetWindowLong(Handle,GWL_STYLE) and not WS_CAPTION);
self.WindowState:=wsMaximized;
end
else
DefaultHandler(Msg);
Application.ProcessMessages;
end;
procedure TForm1.FormKeyDown(Sender: TObject
var Key: Word;
Shift: TShiftState);
begin
if Key=VK_ESCAPE then
begin
showmessage('Ok');
SetWindowLong(Handle,GWL_STYLE,GetWindowLong(Handle,GWL_STYLE) or WS_CAPTION);
WindowState:=wsNormal;
end;
end;
end.
[red]我已将表单的KeyPreView设置为了True,并且chartfx1的align属性值为alClient,[/red]
如果我将Chartfx1控件换成Memo控件或其他含有onkeypress的事件的控件,当表单
全屏时,按ESC键,能将表单恢复.但如果换成如chartfx1和其他不含
有onKeypress,onKeydown等事件的控件时,当按ESC键就没有用.[red]请问各位大侠,有没有
其他的方法当表单上含有chartfx1时,并且chartfx1的align属性值为alClient,
表单全屏时,按ESC键能恢复窗口大小?[/red]谢谢!