| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2418 人关注过本帖
标题:showmodal方法的好处?
只看楼主 加入收藏
帅哥一条虫
Rank: 1
等 级:新手上路
威 望:1
帖 子:65
专家分:0
注 册:2006-10-15
收藏
 问题点数:0 回复次数:6 
showmodal方法的好处?

小弟对showmodal方法不太理解
也不知道怎么个用法
哪位高手帮解释解释
要是有个小例子那就更好了
------------------------------------
谢谢!

搜索更多相关主题的帖子: showmodal 
2007-04-13 02:40
帅哥一条虫
Rank: 1
等 级:新手上路
威 望:1
帖 子:65
专家分:0
注 册:2006-10-15
收藏
得分:0 
窗体.show和窗体.showmodal
那个更好用
2007-04-13 03:07
nongen
Rank: 5Rank: 5
来 自:网络
等 级:贵宾
威 望:17
帖 子:322
专家分:0
注 册:2006-11-25
收藏
得分:0 
showmodal
当前显示的方式。

昨天不是我的,明天不是你的,今天却是我们的。
http://www.
2007-04-13 08:54
帅哥一条虫
Rank: 1
等 级:新手上路
威 望:1
帖 子:65
专家分:0
注 册:2006-10-15
收藏
得分:0 
2007-04-13 12:25
anthony634
Rank: 6Rank: 6
来 自:西南交大
等 级:贵宾
威 望:24
帖 子:653
专家分:10
注 册:2006-6-8
收藏
得分:0 

详细点的在delphi的帮助有:
Shows a form as a modal dialog.

function ShowModal: Integer; virtual;

Description

Use ShowModal to show a form as a modal form. A modal form is one where the application can抰 continue to run until the form is closed. Thus, ShowModal does not return until the form closes. When the form closes, it returns the value of the ModalResult property.

To close a modal form, set its ModalResult property to a nonzero value.

Note: If the form contains buttons with a ModalResult property set to a value other than mrNone, the form automatically closes when the user clicks one of those buttons and returns the ModalResult value as the return value of ShowModal.

You can check the return value against common return values using the global IsAbortResult, IsAnAllResult, IsNegativeResult, or IsPositiveResult functions.


//example:

The following methods are used for buttons in a form that is used as a modal dialog box. The methods cause the dialog box to terminate when the user clicks either the OK or Cancel button, returning mrOk or mrCancel from ShowModal, respectively. You could also set the ModalResult value to mrOk for the OK button and mrCancel for the Cancel button to accomplish the same thing. When the user clicks either button, the dialog box closes.

procedure TMyDialogBox.OKButtonClick(Sender: TObject);

begin
ModalResult := mrOK;
end;

procedure TMyDialogBox.CancelButtonClick(Sender: TObject);
begin
ModalResult := mrCancel;

end;

This code brings up the modal dialog from Form1 when a button is clicked. It causes a Beep if the OK button is clicked.

procedure TForm1.Button1Click(Sender: TObject);

begin
if MyDialogBox1.ShowModal = mrOK then
Beep;

end;
很多东西可以看帮助的,还可以学英语,多好,showmodal是模式窗体

2007-04-13 13:38
初学Delphi
Rank: 3Rank: 3
等 级:新手上路
威 望:9
帖 子:330
专家分:0
注 册:2006-4-4
收藏
得分:0 

应该和c#里面的 showdialog一样吧

2007-04-13 13:47
帅哥一条虫
Rank: 1
等 级:新手上路
威 望:1
帖 子:65
专家分:0
注 册:2006-10-15
收藏
得分:0 
e问看得不太明白
谢谢
2007-04-13 17:36
快速回复:showmodal方法的好处?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015443 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved