delphi数据库系统开发合同管理系统论文范例内容摘要:

coding:=39。 39。 //所使用的文档代码页 Visible:= 1。 //打开文档的窗口是否可见 (filename, confirmconversions,readonly, addtorecentfiles,passworddocument, passwordtemplate,revert, writepassworddocument,writepasswordtemplate, format ,Encoding, Visible)。 itemindex := 1。 ((itemindex))。 //PrintOut方法用于打印指定的文档。 end。 主窗体设计主窗体中主要是通过菜单和工具栏按钮来调用子窗体,合同管理系统主窗体运行结果如图3所示。 图3 合同管理系统主界面1.窗体设计步骤(1)运行Delphi会自动创建一个窗体,设置该窗体为程序主窗体,命名该窗体为“frm_main”,设置窗体的Caption属性为“合同管理系统”;WindowsStyle属性为“wsMaximized”。 (2)在“Standard”组件页中点选“TMainMenu”组件,添加到窗体上,双击该组件进行菜单添加,如图4所示。 图4 主菜单设计(3)在“Standard”组件页中点选“TPanel”组件,在窗体上添加2个TPanel组件,命名为“Panel1”和“Panel3”,设置Bevellnner属性为“bvSpace”;BevelOuter属性为“bvLowered”。 设置Panel1组件的Align属性为“alTop”,设置Panel2组件的Align属性为“alClient”。 (4)在“Additional”组件页中点选“TImage”组件,添加到Panel1组件上,设置Align属性为“alTop”,在Picture属性添加图片。 (5)在“Additional”组件页中点选“TSpeedButton”组件,在TImage1组件上添加9个TSpeedButton组件,默认命名,设置Flat属性为“Tree”(6)在“Additional”组件页中点选“TImage”组件,添加到Panel3组件上,设置Align属性分别为“alLeft”和“alClient”,在Picture属性中添加图片。 (7)在“Win32”组件页中点选“TTreeView”、“TListView”组件、“TRichEdit”组件,添加到窗体上,设置ReadOnly属性为“True”。 (8)在“”组件页中点选“TFileListView”组件,添加到窗体上,设置Visible属性为“False”;设置Mask属性为“*.doc”。 (9)在“Standard”组件页中点选“TPopupMenu”组件,添加到窗体上,双击展开面板添加菜单,如图5所示。 图5 弹出菜单设计(10)在“Win32”组件页中点选“TImagelist”组件,添加到窗体上,双击为其添加图片。 (11)在“Dialog”组件页中点选“TOpenDialog”组件和“TSaveDialog”组件,添加到窗体上。 (12)在“Severs”组件页中点选“TWordApplication”组件和“TWordDoucment”组件,添加到窗体上。 (13)在“Win32”组件页中点选“TStatusBar”组件,添加到窗体上,双击展开面板,单击【Add New(Ins)】按钮添加项,并设置Text如图6所示。 图6 任务栏设计2.程序相关代码在主窗体中会用到2个自定义函数,用来向TreeView1中添加树形选项,代码如下:unit U_htgl。 interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,shellapi, Buttons, StdCtrls, ExtCtrls, Menus, ComCtrls, ImgList, Word2000, OleServer, FileCtrl, jpeg。 type Tfrm_main = class(TForm) MainMenu1: TMainMenu。 procedure loaddata。 //声明函数 procedure Skin_Change()。 private { Private declarations } public { Public declarations } dcx:string。 //定义的全局变量 dr1,dr2,cx,zf:integer。 end。 var frm_main: Tfrm_main。 implementationuses U_lx, U_Data, U_drht, U_xtsz, U_htsy, U_dwxx, U_htqd, U_lxsz, U_htxg, U_htcx, U_cx, U_login, U_ri, U_Public, U_czygl。 {$R *.dfm}procedure。 //函数过程vara,b,c:string。 subt1,subt2:TTreenode。 begin。 with dobegin close。 (39。 select * from 单位信息表39。 )。 open。 end。 if (39。 单位名称39。 ).Valuenull thenbegina:=(39。 单位名称39。 ).Value。 subt1:=(nil,a)。 //向TreeView1中添加单位信息with dobegin close。 (39。 select * from 合同类型39。 )。 open。 end。 while not dobeginb:=(39。 htlx39。 ).Value。 subt2:=(subt1,b)。 //向Treeview1添加合同类型子项with dobegin close。 (39。 select * from 合同 where htlx=:aa39。 )。 (39。 aa39。 ).Value:=b。 open。 end。 while not dobegin c:=(39。 htmc39。 ).Value。 (subt2,c)。 //向Treeview1中添加合同名称子项。 end。 end。 //程序运行时使TreeView中的树形选项展开end。 end。 procedure ()。 //更换界面函数过程 var I:integer。 begin if g_str_skinpath=39。 39。 then exit。 (g_str_skinpath+39。 39。 )。 (g_str_skinpath+39。 39。 )。 (g_str_skinpath+39。 39。 )。 end。 要使程序在运行时调用系统登录窗体并执行上面定义的函数,在窗体的OnShow事件中添加如下代码:(Tfrm_login,frm_login)。 dr1:=0。 dr2:=0。 cx:=0。 xt_path。 //执行公共模块中的函数,用来取得数据库中的系统的各路径:=yb_path。 //设置filelistbox1组件的路径loaddata。 //执行自定义函数skin_change()。 当鼠标单击TreeView1中的一级菜单时不发生变化,当单击的是二级菜单时在Listview1中显示当前二级菜单的下的三级菜单名称,当单击的是三级菜单时在RichEdit中显示文档的内容,TreeView1的单击事件代码如下:procedure (Sender: TObject)。 varlistitem:Tlistitem。 begin。 //清除listview组件中的数据 if then:=false。 if =nil then //只是第一级begin:=false。 :=false。 exit。 endelsebegin:=false。 with dobegin close。 (39。 select * from 合同 where htlx= :a39。 )。 (39。 a39。 ).Value:=。 open。 end。 while not dobegin listitem:=。 :=(39。 htmc39。 ).Value。 end。 :=alClient。 :=true。 end。 if nil then //第三级beginwith dobegin close。 (39。 select * from 合同 where htmc=:b39。 )。 (39。 b39。 ).Value:=。 open。 end。 :=(39。 htnr39。 ).Value。 :=alClient。 :=true。 end。 end。 在TreeView1的OnDblClick事件中添加以下代码,用于在所选中的三级菜单中双击打开Word文档。 procedure (Sender: TObject)。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。