ARTICLE

VB.Net Custom Dial Control - Revised

Posted by Brad Patterson Articles | Visual Basic 2010 May 02, 2005
The VB.Net Custom Dial Control is a custom dial control written using GDI+ and VB.Net. This article and the attached source code is a revised version of my previous article with an extended version of the control.
Download Files:
 
Reader Level:

Learning new aspects of Visual Studios Designer I made this control and added designer support for the control. Each dial control now has the following properties to allow easy access to the control being used:

  • Minimum - Used to set the dial minimum value property.
  • Maximum - Used to set the dials maximum value property.
  • ShowText - Shows text inside the dial.
  • DialPosition - Current value of the dial being used.
  • PositionInc - Allows the dials increment value to be changed.

Code Excerpt:

'<summary>
'Maximum value of dial.
'</summary>

<CategoryAttribute("Appearance"), DescriptionAttribute("Set maximum value of dial to?"), DefaultValueAttribute(359.5f)> _

Public Property Maximum() As Single
Get
Return maximum
End Get
Set
If
DialPosition Value Then
DialPosition = Value
End If
maximum = Value
End Set
End
Property

'<summary>
'Counts get and set
</summary>

<CategoryAttribute("Appearance"), DescriptionAttribute("Sets starting value of dial to?"), DefaultValueAttribute(0.5f)> _
Public Property DialPosition() As Single
Get
Return dialPosition
End Get
Set

dialPosition = Value
If DialPosition = Maximum Then
dialPosition = maximum
End If

If DialPosition < Minimum Then
dialPosition = minimum
End If
If
DialPosition Maximum Then
dialPosition = maximum
End If
Me
.Refresh()
OnValueChanged(
Me)
End Set
End
Property

NOTE: THIS ARTICLE IS CONVERTED FROM C# TO VB.NET USING A CONVERSION TOOL. ORIGINAL ARTICLE CAN BE FOUND ON C# CORNER (WWW.C-SHARPCORNER.COM).

share this article :
post comment
 
Nevron Diagram
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Nevron Diagram
Become a Sponsor