扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流
Public Class UserControl1
创新互联建站-专业网站定制、快速模板网站建设、高性价比怀安网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式怀安网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖怀安地区。费用合理售后完善,10年实体公司更值得信赖。
#Region "变量"
Dim Down_Color As Color = Color.Blue
Dim UP_Color As Color = Color.Gray
Dim Mode As Short = 0
Dim flag As Boolean
Dim offset_X As Integer
Dim offset_Y As Integer
Dim Mouse_P As Point
#End Region
#Region "属性"
'按下颜色
Public Property _DownColor As Color
Get
Return Down_Color
End Get
Set(ByVal value As Color)
Down_Color = value
End Set
End Property
'弹起颜色
Public Property _UpColor As Color
Get
Return UP_Color
End Get
Set(ByVal value As Color)
UP_Color = value
End Set
End Property
'滑动模式 0-横 1-竖
Public Property _Mode As Short
Get
Return Mode
End Get
Set(ByVal value As Short)
Mode = value
End Set
End Property
#End Region
Private Sub UserControl1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.BackColor = UP_Color
End Sub
'鼠标按下
Private Sub UserControl1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
Me.BackColor = Down_Color
Mouse_P = e.Location
flag = True
End Sub
'鼠标移动
Private Sub UserControl1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
If flag = False Then Exit Sub
Select Case Mode
Case 0 '横向·
offset_X = e.X - Mouse_P.X
If Me.Location.X + offset_X + Me.Width = Me.ParentForm.Width Or Me.Location.X + offset_X = 0 Then
flag = False
Else
Me.Location = New Point(Me.Location.X + offset_X, Me.Location.Y)
End If
Case 1 '竖向·
offset_Y = e.Y - Mouse_P.Y
If Me.Location.Y + offset_Y + Me.Height + 30 = Me.ParentForm.Height Or Me.Location.Y + offset_Y = 0 Then
flag = False
Else
Me.Location = New Point(Me.Location.X, Me.Location.Y + offset_Y)
End If
End Select
End Sub
'鼠标弹起
Private Sub UserControl1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
Me.BackColor = UP_Color
flag = False
End Sub
End Class
百度一下DotNetBar for Windows Forms,下载吧。。功能很强大,界面很漂亮。sample很全面。。
如果是.NET平台的,你可以使用ComponentOne Enterprise 全功能.NET控件集中的布局控件实现。也可以试试ComponentOne的LinearGauge 控件,这是一个线性仪表器,显示为一个值和象征参考值的可选范围。线性仪表盘(LinearGauge)控件提供了一个 ShowText 属性,用来决定哪些值以文本显示。
》》传送门:网页链接
PropertyGrid控件,工具箱子带了,一般需要配合自定义控件使用,当然你也可以默认状态使用
但需要设置SelectedObject属性,比如PropertyGrid1.SelectedObject = PropertyGrid1
vb2008的事例,点击Button1就能得到图示的效果
第3方控件就是非官方开发的控件,任何人都可以编写第3方控件,包括你自己。编写控件后生成.DLL文件,然后可以在工具箱里直接引用。至于你那三个控件具体是什么东西,你可以查看对象浏览器,也可以用在代码里使用映像来显示这些控件的方法,属性,事件,接口
TeeChart5
这个画图表很不错。。
百度一下一大堆下载的。
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流