APP下载

浅谈VB的通用对话框《CommonDialog》控件的使用

2016-04-14吐尔逊江·阿布都热合曼阿不都热合曼·艾

电脑知识与技术 2016年5期
关键词:设置

吐尔逊江·阿布都热合曼 阿不都热合曼·艾合买提

摘要:通用对话框《CommonDialog》 控件提供诸如打开和保存文件、设置打印选项、选择颜色和字体等操作的一组标准对话框。运行 Windows 帮助引擎时,控件还能够显示帮助我们介绍了《Visual Basic 程序设计》的通用对话框《Common Dialog》控件的基本属性和案例来详细讨论他的使用。

关键词:通用对话框《CommonDialog》的属性;方法;案例

中图分类号:TP311 文献标识码:A 文章编号:1009-3044(2016)05-0076-02

Abstract: The common dialog box "CommonDialog" provides a set of standard dialog boxes, such as opening and saving files, setting print options, selecting colors, and fonts. Run the windows help engine, the control is also able to display help us to introduce the basic properties and case of the visual basic program design "the common dialog box controls the common dialog" to discuss in detail the use of his.

Key words: common dialog box "CommonDialog" attribute; method; case

我们知道在使用《Visual Basic 程序设计》的时候有很多常用的控件,这就是VB的基本控件。但是我们解决很多实际问题的时候,还需要功能特殊控件,我们知道 VB部件中有大量的控件,这就是VB的 《ActiveX》控件, 所以VB的控件分两种一是基本控件,二是《ActiveX》控件。通用对话框《CommonDialog》控件是ActiveX控件的一部分。 下面我们讨论公共对话框控件的基本属性和使用解决实际问题。

1 通用对话框《Common Dialog》控件

通用对话框《CommonDialog》控件是ActiveX控件,在使用之前必须将其加入到控件工具箱中,“工程”菜单中选定“部件”命令,弹出“部件”对话框,选中“Microsoft CommonDialog Control 6.0”,最后单击“确定”按钮,单击工具箱中的“CommonDialog”控件并在窗体上绘制该控件。在窗体上绘制 CommonDialog 控件时,控件将自动调整大小。Timer控件一样,CommonDialog 控件在运行时不可见。

2 通用对话框《Common Dialog》属性

1)通用对话框的Action 属性Visual Basic常用的属性之一。Action 属性值0到6 ,0表示“无对话框”,1表示“打开”对话框,2表示“另存为”对话框,3表示“颜色”对话框,4表示“字体”对话框,5表示“打印”对话框,6表示“帮助”对话框。属性设置只能在运行时用语句设置: 比如:CommonDialog1.Action =1 显示“打开”对话框。 CommonDialog1.Action =2 显示“另存为”对话框。 CommonDialog1.Action =3 显示“颜色”对话框。……

登录APP查看全文

猜你喜欢

设置
中队岗位该如何设置
船舶防火结构及设置的缺陷与整改
中外医学专业与专科设置对比分析及启示
特殊场景下列控等级转换的设置方案
7招教你手动设置参数
动车段(所)股道有效长设置研究
我国中小学将设置人工智能相关课程
吃纸的妖怪
本刊栏目设置说明
中俄临床医学专业课程设置的比较与思考