DotNet第三方控件使用笔记

上传人:pu****.1 文档编号:485529830 上传时间:2024-02-18 格式:DOC 页数:49 大小:1.16MB
返回 下载 相关 举报
DotNet第三方控件使用笔记_第1页
第1页 / 共49页
DotNet第三方控件使用笔记_第2页
第2页 / 共49页
DotNet第三方控件使用笔记_第3页
第3页 / 共49页
DotNet第三方控件使用笔记_第4页
第4页 / 共49页
DotNet第三方控件使用笔记_第5页
第5页 / 共49页
点击查看更多>>
资源描述

《DotNet第三方控件使用笔记》由会员分享,可在线阅读,更多相关《DotNet第三方控件使用笔记(49页珍藏版)》请在金锄头文库上搜索。

1、DotNet第三方控件使用笔记0、1) ButtonX 控件可实现如下效果:添加新用户凶删除信息回 目保存修改在ButtonX上,是否显示“图像,取决于images 属性2)在“ buttomItem 控件中,是否“只是显示图像“,“只是文本,还是“图像和Default文本都显示,取决于BjttonStyleCanCustomizeCategoryChecked尸心- I . A - .1. - ftLDefaultTextOnlyAlwaysImageAndText1、BalloonTio控件(气泡提示)(1) 使用效果1)效果一:在鼠标在控件上面停留时,出现提示信息,如以下图:Creait

2、e great lookiiLg cmstHUsing Balloon and other ccm, included wi th DotNetBw you create great, looking custom2)效果二:当控件获得焦点时,也出现如上图一样的信息。(2) 实现上述两种效果的途径1)将 BalloonTip 控件的“ShowBalloonOnFacus 属性设置为False即可实现, 效果一。2)将“ShowBalloonOnFacus属性设置为True,即可实现效果二。(3) 设置BalloonTip显示的内容:在欲设置该属性的 控件的BalloonTioOnFocus 上

3、 的 BalloonCaption 和 “BalloonTioOnHover上的BalloonCaption 属性中,分别设置这两种效果的“标题属性;在BalloonTioOnFocus 上的 BalloonText和在BalloonTioOnHover 上的 BalloonText属性中,分别设置这两种效果的“显示内容的属性。4) 属性“ AlerAnimation 设置“ BalloonTip 出现的效果 ,5) “ BalloonTip 除了出现在该控件附近,还可以出现在屏幕的右下角,例如程序如下:private AlertCustom m_AlertOnLoad= null ; m_A

4、lertOnLoad= new AlertCustom ();Rectangle r= Screen .GetWorkingArea( this ); m_AlertOnLoa d.Location= newPoint (r.Right-m_AlertOnLoad.Width,r.Bottom-m_AlertOnLoad.Height); m_AlertOnLoad.AutoClose= true ;m_AlertOnLoad.AutoCloseTimeOut=15; m_AlertOnLoad.AlertAnimation= eAlertAnimation .BottomToTop; m_A

5、lertOnLoad.AlertAnimationDuration=300;m_AlertOnLoad.Show( false ); /false: 指示该控件是否需要获得焦点才出现“BalloonTip( 6)“BalloonTip 除了可以通过“添加控件的方式使用,也可以通过编程的方式使用,例如程序如下:DevComponents.DotNetBar.Balloon b= newDevComponents.DotNetBar. Balloon ();b.Style =eBallonStyle .Alert; b.CaptionImage= balloonTipFocus.CaptionIm

6、age.Clone() as Image; b.CaptionText= Balloon Status Information ;b.Text= Balloons are now enabled for Balloon Tip Test area. Hover mouse over the area and set the focus to any control.;b.AlertAnimation= eAlertAnimation .TopToBottom; b.AutoResize(); b.AutoClose= true ;b.AutoCloseTimeOut=4;b.Owner=thi

7、s ;/ 指示父控件 b.Show(button2, false ) ;/button2 :指示在那个控件附近出现“BalloonTip (7)还可以对“BalloonTip出现时的效果进行程序控制,如下:/ BalloonTriggerControl property returns control that invoked balloon/ BalloonTriggerControl 属性返回触发“BalloonTip 的控件if (balloonTipHover.BalloonTriggerControl=groupBox1) / BalloonControl is already pr

8、epared Balloon control that is just about to be displayed/ Setting BalloonControl to null will cancel balloon display Point p= Control .MousePosition;/ Adjust cursor position so cursor is below tip p.Offset(-balloonTipHover.BalloonControl.TipOffset,balloonTipHover.BalloonControl.TipLength+ 4);/Offse

9、t属性将点p进行平移balloonTipHover.BalloonControl.Location=p;( 8)与之类似的是DotNetToolTip 所有控件都有的“ToolTip 属性,也可以是控件在鼠标划过时出现类似的东西,如以下图Inbox匕氧. Open v our Inbox I2、 DotNetBarManager控件与Bar控件的使用例如效果如以下图:XI国 Forml添加或删除按钮由;?前扇0昌行彳NewCbrl+NOpenCtri+O口。箱Ctrl+X5aveCtrl+SPrint PreviewEriritCtrl+PEmail自定义(1) DotNetBarManage

10、r 控件-将该控件添加到工程后,将给Bar控件提供了 “停靠点(DockSite ),可以实现是工具栏在窗体的“上、下、左、右“摆放。可以通过程序实现,也可以通过“属性页“的 Dock “属性进行设置bar.DockSide =eDockSide .Top;(2) DotNetBarManager控件,通过右键菜单商查看代函1CroatB Dock Bar LeftCreate Dock Bar RightCreate Dock Bar BottDfnCreate Dodk Bar TopCreate Menu BarCreate ToolbarEnable Document Dodhna界剪

11、切出 J复制也 曲糊占 X批除-|孑盾性(B)回 dotNeUBafM* rayw I : yrBiragBi.r5Li 可以轻松实现如以下图所示的布局通过拖动也可以轻易的实现如下视图的布局9tl 口 w Case of Doc urn ent DockingNew Document Show All TabsIXiicumenL LDocumert 3Document 4口rent 4Cteument Ij bflg 图 1叩 t4bs to chgcdockrig IwwtDccu merit 2Docunent 2与上图相应的代码:dockItem= new/ Create new do

12、cument and add it to existing bar DevComponents.DotNetBar. DockContainerltem DevComponents.DotNetBar. DockContainerItem (); dockItem.Text= Custom Document;/ Add control to itTextBox t= new TextBox ();t.AutoSize= false ;t.Multiline= true ;t.Text=dockItem.Text;/ PanelDockContainer will be used to host

13、 any controls. It provides automatic focus management so focused/ document tab appears boldpanelnewDevComponents.DotNetBar. PanelDockContainerDevComponents.DotNetBar. PanelDockContainer ();t.Dock = DockStyle .Fill;panel.Controls.Add(t);dockItem.Control=panel;baU.Items.Add(dockItem);if (!bar1.Visible

14、) bar1.Visible= true ; elsebar1.RecalcLayout();/ Optimize display by disabling layout for all dock sites dotNetBarManager1.SuspendLayout= true ;try foreach (DevComponents.DotNetBar. Bar bar in dotNetBarManager1.Bars) if (bar.DockSide=DevComponents.DotNetBar. eDockSide .Document) foreach (DevComponen

15、ts.DotNetBar. DockContainerItem dock in bar.Items) dock.Visible= true ;if (!bar.Visible) bar.Visible= true ; finally dotNetBarManager1.SuspendLayout= false ;(2X)下面的代码通过编程的方式实现如以下图所示的功能Ml Ax B xleftfiarl TopIeftfiar3-LeftDockContainer line1隐胸的工 具栏Left Deck ContainerWhich Bar I & |Bar2 平 xWtBarl -Bottom Lef

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 资格认证/考试 > 自考

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号