第6章_窗体、控件及组件.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
6.8.2 TreeView控件 【例6-18】演示TreeView控件的用法。 设计界面如下: 6.9其他常用控件 1、选项卡控件(TabControl) TabControl控件用于创建带有多个选项卡(TabPages)的窗口,每个选项卡都相当于一个对话窗口容器,可以在其中独立地存放其他控件对象。 常用属性: ImageList属性:获取或设置当前TabControl控件中的各个标签页使用的图标集合。 MultiLine属性:获取或设置是否可以创建多行选项卡。 TabPages属性:获取该选项卡控件中选项卡页的集合。 6.9.1 选项卡控件(TabControl) 【例6-19】演示TabControl控件的用法。 设计界面 运行界面 6.9.2 面板复合控件 2、面板复合控件(SplitContainer) SplitContainer控件是由两个Panel面板和一个Split拆分条组成的复合体,两个Panel之间的拆分条可以拖动。 6.9.2 面板复合控件 【例6-20】演示SplitContainer控件的基本用法。 运行效果如下: 6.9.3 任务栏图标组件(NotifyIcon) 3、任务栏图标组件(NotifyIcon) NotifyIcon组件主要用于显示通知区域中的图标。NotifyIcon是一个比较特殊的组件,只有运行时才能显示。 常用属性: 【Icon】属性设置出现在状态区域的图标。 【Visible】属性控制是否让图标显示出来。 【Text】属性来指定将鼠标指针放置在图标上时显示的提示信息。 6.9.3 任务栏图标组件(NotifyIcon) 【例6-21】演示NotifyIcon控件的基本用法。 运行效果: 设计效果: 窗体的Load事件,在窗体显示前,执行该事件。 如何添加事件,在窗体设计界面显示时,在属性窗口点击Event图标,双击Load,即可在代码中添加事件原形。 Add some initialization code of your own. The last task is to add some initialization code of your own to Form1. The constructor should never be used to call any code that might throw an exception. Therefore, any such code must be located someplace else, and that location is the Form1_Load method. Click the Form1.cs[Design] tab at the top of the code editor to go back to Windows Form. Select the form and in the Properties window click the Events button (the one with the lightning bolt) and then double-click Load. This will add an event handler method and position your cursor in the method in Code view. When a user starts your program, Windows will notify your applications form by sending a Load event. When the form receives that event, it will call the Form1_Load method. Methods that are called in response to events are called event handlers. The system will call your event at the appropriate time; your job is to put the code into the event handler that you want to execute when the event occurs. 此例使用将篮球、排球、乒乓球三个复选框的CheckedChanged事件关联为下列方法:(在事件窗口中,选取三个复选框的事件处理程序为一个即可) 注意:froeach语句的用法 private void checkBoxGroup_CheckedChan

文档评论(0)

xiaofei2001128 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档