DevExpress 控件用法笔记(VB)
1、ChartControl
显示条形图
ChartControl1.Titles.Clear()
ChartControl1.Series.Clear()
Dim db As DataTable
SqlDataAdapter1.SelectCommand.CommandText =sqlstr
db = New DataTable
SqlDataAdapter1.Fill(db)
Dim series1 As DevExpress.XtraCharts.Series = New DevExpress.XtraCharts.Series("", ViewType.Line)
series1.DataSource = db‘绑定数据源
series1.ArgumentDataMember = "TimeStep" 'X轴显示字段
series1.ValueDataMembers() =cbPara.Text ‘Y轴显示字段
series1.Name = cbPara.Text ’图例名称
ChartControl1.Series.Add(series1)
'标题
Dim chartTitle1 As New ChartTitle()
chartTitle1.Text = cbPara.SelectedItem & "浓度变化曲线"
chartTitle1.Antialiasing = True
chartTitle1.Font = New Font("Tahoma", , FontStyle.Regular)
chartTitle1.TextColor = Color.Black
chartTitle1.Indent =
ChartControl1.Titles.Add(chartTitle1)
'添加x,y轴标题
Dim diam As DevExpress.XtraCharts.XYDiagram = New DevExpress.XtraCharts.XYDiagram
diam.AxisX.Title.Text = "mg/L"
diam.AxisY.Title.Text = "天"
diam.AxisX.Title.Visible = True
diam.AxisY.Title.Visible = True
ChartControl1.Diagram = diam
’自定义标注 Y轴
xydiagram.AxisY.CustomLabels.AddRange({New CustomAxisLabel("一类", ), New CustomAxisLabel("二类", ), New CustomAxisLabel("三类", ), New CustomAxisLabel("四类", ), New CustomAxisLabel("五类", ), New CustomAxisLabel("劣五类", )})
效果如下:
2、 GridControl
绑定代码如下:
GridControl1.DataSource = db 'db是DataTable对象
自定义字段显示如下图:
去掉GroupPanel如下图所示:
3、 WinForm的ComboBox自定义绑定数据
自已定义一个RiverData类的代码:
Public Class RiverData
Dim m_riverName As String
Dim m_riverId As String
Dim m_evtsimId As String Public Property RiverName
Get
Return m_riverName
End Get
Set(ByVal value)
m_riverName = value
End Set
End Property Public Property RiverId
Get
Return m_riverId
End Get
Set(ByVal value)
m_riverId = value
End Set
End Property Public Property EvtSimId
Get
Return m_evtsimId
End Get
Set(ByVal value)
m_evtsimId = value
End Set
End Property End Class
绑定数据的代码如下:
Dim m_river As RiverData = New RiverData
m_river.RiverName = tName
m_river.RiverId = tRiver
cbSec.Items.Add(m_river)
cbSec.DisplayMember = "RiverName"
cbSec.ValueMember = "RiverId"
4、LabelControl
设置AutoSizeMode的属性为Vertical,适当的Size,就可以实现文本的换行。
5、NavBarControl
For i As Integer = To dt.Rows.Count - Step
Dim NavBarGroup1 As DevExpress.XtraNavBar.NavBarGroup = New DevExpress.XtraNavBar.NavBarGroup '创建分组栏
NavBarGroup1.Caption = dt.Rows(i)().ToString()
NavBarGroup1.Name = "NavBarGroup" + i.ToString()
'站点信息
Dim navBarGroupControlContainer1 As NavBarGroupControlContainer = New NavBarGroupControlContainer '创建容器面板
For j As Integer = To Step
Dim lable1 As DevExpress.XtraEditors.LabelControl = New DevExpress.XtraEditors.LabelControl
lable1.Location = New System.Drawing.Point(, * j - )
Select Case j
Case
lable1.Text = "XX: "
lable1.Location = New System.Drawing.Point(, )
Case
lable1.Text = "XX: "
Case
lable1.Text = "XX: "
Case
lable1.Text = "XX: "
Case
lable1.Text = "XX: "
Case
lable1.Text = "XX: "
Case
lable1.Text = "XX: "
Case
lable1.Text = "XX: "
Case
lable1.Text = "XX: "
End Select
lable1.Text += dt.Rows(i)(j).ToString()
lable1.Name = "Lb_Title" + j.ToString
lable1.Size = New System.Drawing.Size(, )
navBarGroupControlContainer1.Controls.Add(lable1) '容器面板添加Lable
Next
'创建内容面板
navBarGroupControlContainer1.Size = New System.Drawing.Size(, )
navBarGroupControlContainer1.ResumeLayout(False)
navBarGroupControlContainer1.PerformLayout()
NavBarGroup1.ControlContainer = navBarGroupControlContainer1
NavBarControl1.Controls.Add(navBarGroupControlContainer1)
NavBarControl1.Groups.Add(NavBarGroup1)
Next
效果图如下:
6、ImageComboBoxEdit 用法
ImageComboBoxItem icbi = new ImageComboBoxItem();
icbi.Description ="aa";
icbi.Value =;
ImgComBox_Layers.Properties.Items.Add(icbi);
ImgComBox_Layers.EditValue = ;
7、AllowFormGlass属性设置窗体的时候,使用的是RibbonForm窗体,但是标题栏没有DEV的样式效果,如下图:
但是demo上有dev效果,如下图:
后来对比发现是主窗体设计代码少了一行代码所致:
Me.AllowFormGlass = DevExpress.Utils.DefaultBoolean.[False]
dev帮助文档解释如下:
获取或设置窗体的标题和边框是否根据本地的Windows主题。
注意:如果加上上面代码,添加ArcEngine控件的时候,调试程序会报错->“未将对象引用到对象的实例”,具体问题原因还没有找到,应该是个Bug,解决办法:将ArcEngine控件放在Panel控件上就可以了。
8、For循环
For i As Integer = To m_ZoomPopupMenu.ItemLinks.Count -
If TypeOf pItem Is DevExpress.XtraBars.BarButtonItem Then
End If
Next
9、动态生成DockPanel
执行代码前:
执行代码后:
生成DockPanel的代码:
Dim QuikeSearchDock As DockPanel = MainFrom.MainDockManager.AddPanel(DockingStyle.Bottom)
QuikeSearchDock.Show()
If QuikeSearchDock.RootPanel IsNot QuikeSearchDock Then
QuikeSearchDock.DockAsTab(QuikeSearchDock.RootPanel)
Else
Dim container As DockPanel = Nothing
For Each container In MainFrom.MainDockManager.RootPanels
If container.Dock = DockingStyle.Bottom Then
container.Index = '显示新添加的tap
Exit For
End If
Next
If container IsNot Nothing Then
QuikeSearchDock.DockAsTab(container)
End If
QuikeSearchDock.Dock = DevExpress.XtraBars.Docking.DockingStyle.Fill
QuikeSearchDock.Text = title
10、TreeList
TreeList的节点也可以分列显示,所以在使用的时候先要添加列,如下图所示,右键控件,点击Run Designer
然后就可以编写代码了
Public Function LoadControl(ByVal ErrFacs As List(Of ErrorFactor))
For i As Integer = To ErrFacs.Count -
Dim errfac As ErrorFactor = ErrFacs(i)
Dim errnode As TreeListNode = TreeList1.Nodes.Add(errfac.ErrName, Nothing)
TreeList1.AppendNode(New Object() {errfac.ErrFieldName}, errnode)
TreeList1.AppendNode(New Object() {errfac.ErrDescription}, errnode)
Next
End Function
ShowIndicator属性,是否显示指示器
设置前:
设置前效果:
设置后:
设置后效果:
11、XtraForm
继承XtraForm 需要添加如下引用:
DevExpress 控件用法笔记(VB)的更多相关文章
- asp.net中Repeater控件用法笔记
大家可能都对datagrid比较熟悉,但是如果在数据量大的时候,我们就得考虑使用 repeater作为我们的数据绑定控件了.Repeater控件与DataGrid (以及DataList)控件的主要区 ...
- 十三、asp.net中Repeater控件用法笔记
大家可能都对datagrid比较熟悉,但是如果在数据量大的时候,我们就得考虑使用 repeater作为我们的数据绑定控件了.Repeater控件与DataGrid (以及DataList)控件的主要区 ...
- DevExpress控件学习总结 z
1.Navigation & Layout 1.1 Bar Manager 如果想在窗体或用户控件(user control)上添加工具条(bars)或弹出菜单(popup menus),我们 ...
- DevExpress控件学习总结(转)
DevExpress控件学习总结 1.Navigation & Layout 1.1 Bar Manager 如果想在窗体或用户控件(user control)上添加工具条(bars)或弹 ...
- DevExpress控件学习总结
1.Navigation & Layout 1.1 Bar Manager 如果想在窗体或用户控件(user control)上添加工具条(bars)或弹出菜单(popup menus),我们 ...
- DevExpress控件的GridControl控件小结
DevExpress控件的GridControl控件小结 (由于开始使用DevExpress控件了,所以要点滴的记录一下) 1.DevExpress控件组中的GridControl控件不能使横向滚动条 ...
- DevExpress控件安装、汉化使用教程
前言 DevExpress是一个庞大的控件库,也很是好用(没用过,听说),但是要收费. 网上关于DevExpress的教程满天飞,我找了一下午也没找到正确的安装.简单实用教程,还是自己摸索吧. 自己动 ...
- 关于Datagridview控件用法的一些总结(设置列chicun)
1. 关于Datagridview控件用法的一些总结:http://www.cnblogs.com/mingjiatang/p/4968049.html
- 在Winform开发框架中,利用DevExpress控件实现数据的快速录入和选择
在实际的项目开发过程中,有好的控件或者功能模块,我都是想办法尽可能集成到我的WInform开发框架中,这样后面开发项目起来,就可以节省很多研究时间,并能重复使用,非常高效方便.在我很早之前的一篇博客& ...
随机推荐
- hdu 1556 Color the ball(区间更新,单点求值)
Color the ball Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)To ...
- 用复制方式创建表 Create Table tbname as select * from user.tab where ...
用复制方式创建表 Create Table tbname as select * from user.tab where ...
- java StringBuffer 与 StringBuilder
String是不可变类,一旦String对象被创建,包含在对象中的字符序列是不可变的,直到对象被销毁: StringBuffer 与 StringBuilder对象则是可变的! 举例说明这两个的好处: ...
- PC端网页特效
元素偏移量offset系列 offset翻译过来就是偏移量,我们使用offset系列相关属性可以动态的得到该元素的位置(偏移),大小等 获得元素距离带有定位父元素的位置 获得元素自身的大小(宽度高度) ...
- Apache工具集
commons-collections-3.2.jar 转自:http://www.open-open.com/lib/view/open1384437456993.html
- Linux 内核设备驱动
设备模型跟踪所有对系统已知的驱动. 这个跟踪的主要原因是使驱动核心能匹配驱动和新 设备. 一旦驱动在系统中是已知的对象, 但是, 许多其他的事情变得有可能. 设备驱动可 输出和任何特定设备无关的信息和 ...
- poj1080 - Human Gene Functions (dp)
题面 It is well known that a human gene can be considered as a sequence, consisting of four nucleotide ...
- Android一般什么情况下会导致内存泄漏
资料参考:https://blog.csdn.net/u011479990/article/details/78480091 内存泄漏的原因在于生命周期长的对象持有了生命周期短的对象的引用 内存泄漏形 ...
- 【Kubernetes】部署K8s-dashboard v1.10.1
一.官方kubernetes-dashboard.yaml简介 ①首先认识一下官方的kubernetes-dashboard.yaml,我们先下载: https://github.com/kubern ...
- 在Android上为所欲为的一些技术
https://www.jianshu.com/p/87ce6f565d37Android JNI(一)——NDK与JNI基础 https://www.android-doc.com/guide/co ...