All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
C#编程技巧,轻松实现对文件的操作_.net资料_编程技术
让Windows主机在IIS支持PHP和MySQL_[PHP教程]
全面解读垂直搜索引擎_php资料_编程技术
ASP.NET Remoting体系结构(四)
网页特效之HTML中树的实现方法_JavaScript技术_编程技术
浅谈.NET中的数据绑定表达式_[Asp.Net教程]
对比两个DataTable是否相同的正确方法_[Asp.Net教程]
ASP.NET开发经验(4):种简便地同时使用匿名与集成,Windows,验证的方法_[Asp.Net教程]
delphi MapViewOfFile函数将映像文件映射到进程
my.ini详解_php资料_编程技术
Reading number is top 10 pictures
2012 national geographic daily picture8
The money of more than 100 countries and regions10
Fierce chengdu woman, street rape man
Angie Chiu vijara myth2
Shandong jinan is about to dismantle a one hundred-year history of the building
The hot big eye big breast beauty1
治疗多发性骨髓瘤的特效药,一万二一支
Born After 90 Beijing sports university campus flower photos3
NeedWallpaper2
Absolutely shocked. National geographic 50 animal photographys6
Download software ranking
Unix video tutorial11
Eclipse 4.2.2 For Win32
The cock of the Grosvenor LTD handsome
WebService在.NET中的实战应用教学视频 → 第2集
Detective task-the top secret prostitution files
Proficient in JavaScript
Ashlynn Video2
Eclipse 4.2.2 For Win64
Unix video tutorial7
中国结婚习俗实录
aaa published in(发表于) 2014/7/19 0:09:24 Edit(编辑)
Delphi以图形按钮显示的界面

Delphi以图形按钮显示的界面

Delphi以图形按钮显示的界面

Delphi以图形按钮显示的界面

实例说明

菜单和工具栏虽然能方便用户操作程序的相应功能,但各有缺点。如果采用按钮式功能菜单,不但美观大方,而且操作灵活。当单击按钮时,用户区将显示相应的操作按钮组。下面介绍图形界面式菜单的设计方法。运行本例,效果如图1.17所示。



图1.17Delphi以图形按钮显示的界面

技术要点

本例中用到了ChDir()函数。该函数的原型如下:

procedure Chdir(const S:string);overload;

procedure ChDir(P:PChar);overload;

参数说明:

S,P 当前目录的指定路径。

功能:改变当前目录的指定路径。

在该实例中用到了ExtracFilePath()函数。该函数原型如下:

function ExtractFilePath(const FileName:string):string;

参数说明:

FileName 文件名,包含驱动器和目录。

功能:该函数从FileName指定的文件名中提取驱动器恶化目录部分,生成的字符串从FileName最左边的字符开始,直到冒号或反斜线符号为止,并包含冒号或反斜线符号。若FileName参数不包含驱动器和目录,则生成的字符串为空。该函数用于多字符集系统(MBCS)。

在本例中的ExtractFilePath() 函数是为了获取图片的路径。

注意:在本例中不宜使窗体最大化。如最小化,将是TSpeedButton组件不在正确的位置。

实现过程

1.新建一个标准工程,创建一个新窗体,设置窗体的Name属性为FRM_ERP_ZJM。

2.在窗体上放置TActionManager、TMainMenu、TPanel、TStatusBar、TTimer、TLabel和TSpeedButton组件。

3.相关组件的主要属性如表1.6所示。

表1.6 主要组件的属性设置

4.主要程序代码如下:

自定义函数:

procedure TFRM_ERP_ZJM.ttp(tt : integer);

begin

SpeedButton1.Visible := false;

SpeedButton2.Visible := false;

SpeedButton3.Visible := false;

SpeedButton4.Visible := false;

SpeedButton5.Visible := false;

SpeedButton6.Visible := false;

SpeedButton7.Visible := false;

SpeedButton8.Visible := false;

SpeedButton9.Visible := false;

SpeedButton10.Visible := false;

SpeedButton11.Visible := false;

SpeedButton12.Visible := false;

SpeedButton13.Visible := false;

SpeedButton14.Visible := false;

end;

Label组件的OnClick处理事件:

procedure TFRM_ERP_ZJM.Label1Click(Sender: TObject);

begin

image2.Picture.CleanupInstance;

image3.Picture.CleanupInstance;

chdir(ExtractFilepath(Application.ExeName));

image2.Picture.LoadFromFile('图片12.jpg');

image3.Picture.LoadFromFile('图片13.jpg');

ttp(1);

speedbutton1.Action := Action2;

speedbutton2.Action := Action3;

SpeedButton1.Caption:='';

SpeedButton2.Caption:='';

end;




添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.