我想动态的改变窗体的大小,比如说单击某按钮使得form的width增加,但是由于窗体的重画,闪烁得很厉害。请问如何处理才能得到不闪烁的效果。
解决方案 »
- 如何在编辑框上输入内容,而自动sendmessage到记事本上同时输入?分数不够,梢后给你加.
- 数据报表打印问题
- boss提了个需求,直接傻了。。
- result:=tstringlist.Create;最后没有free语句,会不会内存泄漏?
- 请指正SQL语句错误
- 请问,应该用哪个API函数来获取操作系统当前所使用的字体(大字体-120dpi, 小字体-96dpi)大小,用GetDeviceCaps(hdc,LOGPIXELSX)取到的只是
- 救命啊!!!delphi不认识URLdownloadtofile啊???
- 怎样让MapX中嵌入的一幅地图中的一个五角星进行闪烁(delphi)!
- 请教大虾一个菜鸟问题,高分相送
- 为什么不能保存?为什么只能为只读?为什么从新启动,数据就没了?
- help me!!!delphi7的报表控件在那里啊?
- 请教各位斑竹与高手:关于ActiveX控件
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
Normal: boolean;implementation{$R *.dfm}
//请看下面两个相互呼应的函数。都可以解决你的问题。你喜欢那个就那个呗。
// DisableAlign EnableAlign
//LockWindowUpdate(handle); LockWindowUpdate(0);
procedure TForm1.Button1Click(Sender: TObject);
begin
DisableAlign;
//LockWindowUpdate(handle);
if Normal then
begin
Self.Width := Self.Width div 2;
Self.Height := Self.Height div 2;
end
else begin
Self.Width := Self.Width * 2;
Self.Height := Self.Height * 2;
end;
//LockWindowUpdate(0);
EnableAlign;
Normal := not Normal;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
Normal := true;
end;end.