ImageVerifierCode 换一换
格式:DOCX , 页数:98 ,大小:810.62KB ,
资源ID:15688020      下载积分:5 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-15688020.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(DotNet第三方控件使用笔记.docx)为本站会员(b****7)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

DotNet第三方控件使用笔记.docx

1、DotNet第三方控件使用笔记DotNet第三方控件使用笔记1、 1) ButtonX控件可实现如下效果: 在ButtonX上,是否显示“图像,取决于“images“属性2)在“buttomItem“控件中,是否“只是显示图像”,”只是文本”,还是“图像和文本都显示”,取决于2、 BalloonTio控件(气泡提示)(1) 使用效果1) 效果一:在鼠标在控件上面停留时,出现提示信息,如下图: a) 效果二:当控件获得焦点时,也出现如上图一样的信息。(2) 实现上述两种效果的途径1) 将BalloonTip控件的“ShowBalloonOnFacus”属性设置为“False”即可实现,效果一。2

2、) 将“ShowBalloonOnFacus”属性设置为“True”,即可实现效果二。(3) 设置BalloonTip显示的内容:在欲设置该属性的控件的“BalloonTioOnFocus上的BalloonCaption”和“BalloonTioOnHover上的BalloonCaption”属性中,分别设置这两种效果的“标题”属性; 在“BalloonTioOnFocus上的BalloonText”和在“BalloonTioOnHover上的BalloonText”属性中,分别设置这两种效果的“显示内容”的属性。(4) 属性“AlerAnimation”设置“BalloonTip”出现的效果

3、,(5) “BalloonTip”除了出现在该控件附近,还可以出现在屏幕的右下角,示例程序如下: private AlertCustom m_AlertOnLoad=null;m_AlertOnLoad=new AlertCustom(); Rectangle r=Screen.GetWorkingArea(this); m_AlertOnLoad.Location=new Point(r.Right-m_AlertOnLoad.Width,r.Bottom-m_AlertOnLoad.Height); m_AlertOnLoad.AutoClose=true; m_AlertOnLoad.A

4、utoCloseTimeOut=15; m_AlertOnLoad.AlertAnimation=eAlertAnimation.BottomToTop; m_AlertOnLoad.AlertAnimationDuration=300; m_AlertOnLoad.Show(false);/false:指示该控件是否需要获得焦点才出现“BalloonTip”(6)“BalloonTip”除了可以通过“添加控件”的方式使用,也可以通过编程的方式使用,示例程序如下: DevComponents.DotNetBar.Balloon b=new DevComponents.DotNetBar.Bal

5、loon(); b.Style=eBallonStyle.Alert; b.CaptionImage=balloonTipFocus.CaptionImage.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.TopToBo

6、ttom; b.AutoResize(); b.AutoClose=true; b.AutoCloseTimeOut=4; b.Owner=this;/指示父控件 b.Show(button2,false);/button2:指示在那个控件附近出现“BalloonTip” (7)还可以对“BalloonTip”出现时的效果进行程序控制,如下: / BalloonTriggerControl property returns control that invoked balloon/ BalloonTriggerControl属性返回触发“BalloonTip”的控件 if(balloonTip

7、Hover.BalloonTriggerControl=groupBox1) / BalloonControl is already prepared 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 tipp.Offset(-balloonTipHover.BalloonC

8、ontrol.TipOffset,balloonTipHover.BalloonControl.TipLength+4);/Offset属性将点p进行平移 balloonTipHover.BalloonControl.Location=p; (8)与之类似的是DotNetToolTip所有控件都有的“ToolTip”属性,也可以是控件在鼠标划过时出现类似的东西,如下图3、 DotNetBarManager控件与Bar控件的使用 示例效果如下图:(1) DotNetBarManager控件 -将该控件添加到工程后,将给Bar控件提供了“停靠点(DockSite)”,可以实现是工具栏在窗体的“上、

9、下、左、右“摆放。 可以通过程序实现,也可以通过“属性页“的”Dock“属性进行设置。 bar.DockSide = eDockSide.Top;(2) DotNetBarManager控件,通过右键菜单可以轻松实现如下图所示的布局。通过拖动也可以轻易的实现如下视图的布局与上图相应的代码:/ Create new document and add it to existing barDevComponents.DotNetBar.DockContainerItem dockItem=new DevComponents.DotNetBar.DockContainerItem();dockItem

10、.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 any controls. It provides automatic focus management so focused/ document tab appears boldDevComponents.DotNetBar.PanelDockContainer panel

11、 = new DevComponents.DotNetBar.PanelDockContainer();t.Dock = DockStyle.Fill;panel.Controls.Add(t);dockItem.Control=panel;bar1.Items.Add(dockItem);if(!bar1.Visible)bar1.Visible=true;elsebar1.RecalcLayout();/ Optimize display by disabling layout for all dock sitesdotNetBarManager1.SuspendLayout=true;t

12、ryforeach(DevComponents.DotNetBar.Bar bar in dotNetBarManager1.Bars)if(bar.DockSide=DevComponents.DotNetBar.eDockSide.Document)foreach(DevComponents.DotNetBar.DockContainerItem dock in bar.Items)dock.Visible=true;if(!bar.Visible)bar.Visible=true;finallydotNetBarManager1.SuspendLayout=false;(2)下面的代码通

13、过编程的方式实现如下图所示的功能private void Form1_Load(object sender, System.EventArgs e)dotNetBarManager1.DockTabChange+=new DotNetBarManager.DockTabChangeEventHandler(this.DockTabChanged);CreateBottomBarAutoHide();CreateLeftDockedBars();private void DockTabChanged(object sender, DockTabChangeEventArgs e)/ Sync c

14、aption of the bar with the currently selected dock tabBar bar=sender as Bar;if(bar=null | e.NewTab=null)return;bar.Text=e.NewTab.Text;private void CreateBottomBarAutoHide()Bar bar=new Bar(Bottom Bar in auto-hide state);bar.Name=bottomBar;bar.LayoutType=eLayoutType.DockContainer; / Dock Container Lay

15、out needed for dockable windowsbar.Stretch=true; / Dockable windows stretch to fill containerbar.AutoHideAnimationTime=0; / Some controls do not support animation so turn it offbar.GrabHandleStyle=eGrabHandleStyle.Caption; / Dockable Windows have captionsdotNetBarManager1.Bars.Add(bar); / DotNetBar

16、needs to be aware of the bar so it can manage its docking etc./ Create hosted controlsDockContainerItem dockItem=new DockContainerItem(bottomDockItem1,First dock item);bar.Items.Add(dockItem);/ Create control that we want to host on dockable windowUserControl1 dockedControl=new UserControl1();docked

17、Control.label1.Text=bar.Name+ - +dockItem.Text;dockedControl.BackColor=Color.Azure;dockItem.Control=dockedControl; / Specify that control is hosted on the dock containerdockItem.Height=128; / Specify the height of the dockable container and at the same time control/ Create second dock container and

18、add it to the bardockItem=new DockContainerItem(bottomDockItem2,Second dock item);bar.Items.Add(dockItem);dockedControl=new UserControl1();dockedControl.label1.Text=bar.Name+ - +dockItem.Text;dockedControl.BackColor=Color.Aquamarine;dockItem.Control=dockedControl; / Specify that control is hosted on

19、 the dock container/ Dock bar to bottom dock sitedotNetBarManager1.BottomDockSite.GetDocumentUIManager().Dock(bar);dockItem.Height=128; / Specify the height of the dockable container and at the same time controlbar.RecalcLayout(); / Apply all changes.bar.AutoHide=true; / Place bar in auto-hide mode.

20、 Bar needs to be docked before it can be places in auto-hide modeprivate void CreateLeftDockedBars()/ Dock first two bars side by side and dock third bar next to them.Bar bar=new Bar(Bar1);bar.Name=leftBar1;bar.LayoutType=eLayoutType.DockContainer; / Dock Container Layout needed for dockable windows

21、bar.Stretch=true; / Dockable windows stretch to fill containerbar.AutoHideAnimationTime=0; / Some controls do not support animation so turn it offbar.GrabHandleStyle=eGrabHandleStyle.Caption; / Dockable Windows have captionsbar.CanHide=true;/ Create DockContainerItem for the bar. The item should be

22、added before the bar is docked.DockContainerItem dockItem=new DockContainerItem(leftDockItem1,Top Left Dock Container);bar.Items.Add(dockItem);/ Create control that is hosted on dock containerUserControl1 dockedControl=new UserControl1();dockedControl.label1.Text=bar.Name+ - +dockItem.Text;dockedCon

23、trol.BackColor=Color.Khaki;dockItem.Control=dockedControl; / Specify that control is hosted on the dock containerdotNetBarManager1.Bars.Add(bar); / DotNetBar needs to be aware of the bar so it can manage its docking etc.dotNetBarManager1.LeftDockSite.GetDocumentUIManager().Dock(bar); /Performs actua

24、l docking of the Bar to the specified dock sitedockItem.Width=128; / Specify Width of dock container item after it is docked/ Create second bar and dock it below the first bar but still on the same lineBar bar2=new Bar(Bar2);bar2.Name=leftBar2;bar2.LayoutType=eLayoutType.DockContainer; / Dock Contai

25、ner Layout needed for dockable windowsbar2.AutoHideAnimationTime=0; / Some controls do not support animation so turn it offbar2.Stretch=true; / Dockable windows stretch to fill containerbar2.CanHide=true;bar2.GrabHandleStyle=eGrabHandleStyle.Caption; / Dockable Windows have captions/ Add new Dock Co

26、ntainer to the bar, should be done before adding the bar so size can be calculated properlydockItem=new DockContainerItem(leftDockItem2,Bottom Left Dock Container);bar2.Items.Add(dockItem);/ Create control that is hosted on dock containerdockedControl=new UserControl1();dockedControl.label1.Text=bar

27、.Name+ - +dockItem.Text;dockedControl.BackColor=Color.Lavender;dockItem.Control=dockedControl; / Specify that control is hosted on the dock containerdotNetBarManager1.Bars.Add(bar2); / DotNetBar needs to be aware of the bar so it can manage its docking etc.dotNetBarManager1.LeftDockSite.GetDocumentU

28、IManager().Dock(bar, bar2, eDockSide.Bottom); / Dock new bar2 below the bar that we created previously/ Create third bar that is docked next to the first and second/ i.e. on the line 1bar=new Bar(Bar3);bar.Name=leftBar3;bar.LayoutType=eLayoutType.DockContainer; / Dock Container Layout needed for doc

29、kable windowsbar.AutoHideAnimationTime=0; / Some controls do not support animation so turn it offbar.Stretch=true; / Dockable windows stretch to fill containerbar.CanHide=true;bar.GrabHandleStyle=eGrabHandleStyle.Caption; / Dockable Windows have captionsdockItem=new DockContainerItem(leftDockItem3,L

30、eft Dock Container line 1);bar.Items.Add(dockItem);/ Create control that is hosted on dock containerdockedControl=new UserControl1();dockedControl.label1.Text=bar.Name+ - +dockItem.Text;dockedControl.BackColor=Color.LemonChiffon;dockItem.Control=dockedControl; / Specify that control is hosted on the

31、 dock containerdotNetBarManager1.Bars.Add(bar); / DotNetBar needs to be aware of the bar so it can manage its docking etc.dotNetBarManager1.LeftDockSite.GetDocumentUIManager().Dock(bar);/ Setting the width of the dock site will also scale the bars docked inside,/ however the size should be large enough to accomodate all bars including the constraints like MinimumSize etc.dotNetBar

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2