荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: zzt (少年仲永), 信区: Program
标  题: DELPHI TIPS(4)
发信站: BBS 荔园晨风站 (Fri Apr 16 18:17:32 1999), 转信

ZDTips brings you another Delphi Tip

http://www.zdtips.com -- Your #1 source for software tips and techniques
*******************************************************************

Today's sponsor:

ZD Journal's Delphi Developer's Journal
For a free issue go to
http://www.zdjournals.com/forms/ddj/cuvw79.htm
*******************************************************************

This week's Delphi Tip

Make a form Showmodal by using Show

Sometime you have a form that you would like to act like a showmodal form
but you would like the calling form to control it. An example of this is
when you are displaying a progress dialog. The problem is that if you use
Showmodal then all your code to perform the operation must exist in the
showmodal form, this is not always the desired way to coding. An easy way
to do this is to use DisableTaskWindows and EnableTaskWindows to make your
dialog act like a showmodal form but at the same time allow the calling
form to control the dialog.

procedure TForm1.ShowProgressDlg;
var
WindowList: Pointer;
begin
{Disables all forms except Form2}
WindowList := DisableTaskWindows(Form2.Handle);
try

Form2.Show;

{Loop that performs a task}
Form2.ProgressBar1.Position := Form2.ProgressBar1.Position + 1;
{end loop}

finally
{enable all forms again}
EnableTaskWindows(WindowList);
Form2.Close;
end;
end;

From--Richard Todosichuk [RTodosic@neri.org]
*******************************************************************

Tips and suggestions can be sent to

delphi_dev@zdjournals.com

We'll print your name and your e-mail or Web address, along with the tip.
*******************************************************************

This weekly tip is delivered to you as a free service from ZDTips.
To unsubscribe from a particluar tip (or tips) list go to

http://www.zdtips.com/unsub/

Type in the e-mail address and name you used to sign up for your tips and
then click unsubscribe.
*******************************************************************

ZDTips (TM) is a trademark of Ziff-Davis Inc. Copyright ?1997
Ziff-Davis Inc. All rights reserved. Reproduction in whole or in part
in any form or medium without express written permission of Ziff-Davis
is prohibited.



--



日出东方,唯我不败;
    天上地下,唯我独尊。

※ 来源:.BBS 荔园晨风站 bbs.szu.edu.cn.[FROM: 192.168.1.143]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店