楼上说的方法肯定行.到处都用的.你怎么测试的啊 function Refurbish: Integer; begin try screen.cursor := crHourGlass; //函数:你要处理的数据 finally screen.Cursor := crDefault; end; end;
那个例子是让你做参考的,思路就跟xjjrocker说的一样.
screen.cursor := crSQLWait; if is_mkdm='first' then begin application.CreateForm(tf_YSGL_FHDCX, f_YSGL_FHDCX); f_YSGL_FHDCX.S_BS:='N'; f_YSGL_FHDCX.ShowModal; end else begin application.CreateForm(tf_YSGL_FHDCX, f_YSGL_FHDCX); f_YSGL_FHDCX.S_BS:='Y'; f_YSGL_FHDCX.ShowModal; end; screen.cursor := crDefault; 这样写不对吗?点了按钮后一闪就没了,窗体却要很长时间才出来.
不知道是我们理解你的问题,还是你没有理解想要问什么。这么多人关心还说每人关心。 这样绝对可以。 function Refurbish: Integer; begin try screen.cursor := crHourGlass; //函数:你要处理的数据 finally screen.Cursor := crDefault; end; end;
To:foxyy8888,大家说的我测试过. 我用一个button打开一个查询窗体很简单的只有一个查询和一个dbgrid显示结果,我在button中采用如下的语句: screen.cursor := crSQLWait; if is_mkdm='first' then begin application.CreateForm(tf_YSGL_FHDCX, f_YSGL_FHDCX); f_YSGL_FHDCX.S_BS:='N'; f_YSGL_FHDCX.ShowModal; end else begin application.CreateForm(tf_YSGL_FHDCX, f_YSGL_FHDCX); f_YSGL_FHDCX.S_BS:='Y'; f_YSGL_FHDCX.ShowModal; end; screen.cursor := crDefault; 执行的结果是在查询窗体出来前鼠标一点都没有改变的样子,一闪就过去了,想请大家帮我再想想办法..
start: boolean=false;
procedure TForm1.Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
screen.Cursor := crDefault;
end;procedure TForm1.Button2Click(Sender: TObject);
var
i: integer;
begin
screen.cursor := crHourGlass;try
for i := 0 to 100000000 do
begin
//do sth
start := true;
application.ProcessMessages;
end;
finally
screen.cursor := crDefault;
start := false;
end;
end;procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if start then
screen.cursor := crHourGlass;
end;
screen.cursor := crDefault;,这样就实现了你的要求。呵呵,秋秋也在到处抢分哦,呵呵……
function Refurbish: Integer;
begin
try
screen.cursor := crHourGlass;
//函数:你要处理的数据
finally
screen.Cursor := crDefault;
end;
end;
if is_mkdm='first' then
begin
application.CreateForm(tf_YSGL_FHDCX, f_YSGL_FHDCX);
f_YSGL_FHDCX.S_BS:='N';
f_YSGL_FHDCX.ShowModal;
end
else
begin
application.CreateForm(tf_YSGL_FHDCX, f_YSGL_FHDCX);
f_YSGL_FHDCX.S_BS:='Y';
f_YSGL_FHDCX.ShowModal;
end;
screen.cursor := crDefault;
这样写不对吗?点了按钮后一闪就没了,窗体却要很长时间才出来.
修改Screen.cursor,仅仅是改变和鼠标视觉外观,并没有达到你所要的要求。因为这个时候“忙”的鼠标指针仍然可以点东西,而不是被禁止点东西。
而VC++的BeginWaitCursor和EndWaitCursor可以很好的完成这项任何。
期待高手进一步做答
另外想要鼠标显示沙漏同时不能点击任何东西delphi当然可以做到,也许只是你不知道而已,多看看查找资料,相信一旦解决,你一定能感受到很多实实在在的知识。祝你好运,不是不帮忙,的确赶个项目,不好意思啊:)
这样绝对可以。
function Refurbish: Integer;
begin
try
screen.cursor := crHourGlass;
//函数:你要处理的数据
finally
screen.Cursor := crDefault;
end;
end;
我用一个button打开一个查询窗体很简单的只有一个查询和一个dbgrid显示结果,我在button中采用如下的语句:
screen.cursor := crSQLWait;
if is_mkdm='first' then
begin
application.CreateForm(tf_YSGL_FHDCX, f_YSGL_FHDCX);
f_YSGL_FHDCX.S_BS:='N';
f_YSGL_FHDCX.ShowModal;
end
else
begin
application.CreateForm(tf_YSGL_FHDCX, f_YSGL_FHDCX);
f_YSGL_FHDCX.S_BS:='Y';
f_YSGL_FHDCX.ShowModal;
end;
screen.cursor := crDefault;
执行的结果是在查询窗体出来前鼠标一点都没有改变的样子,一闪就过去了,想请大家帮我再想想办法..