Click here to Skip to main content
11,644,284 members (65,374 online)
Click here to Skip to main content

VB.NET Knob Control using Windows Forms and GDI+

, 11 Jul 2002 127.7K 2.6K 38
Rate this:
Please Sign up or sign in to vote.
User Drawn Control for .NET Winforms using GDI+

Knob Control Image

This code was originally written by Jigar Desai using C#. Naturally, as a VB Programmer, I needed to see if this control could be readily implemented using VB.NET. After many hours of hair pulling, this control has been successfully ported to VB.NET . Additionally, I added a new design-time property to the original control which allows the Knob Color to take on a different color than the control's background. The only change to the original code is the addition of the "KnobColor" Property. I have included the "TestKnobControl" Project to demonstate the use of this control's ValueChanged Event as well as the vast array of different colors now available for the control.

This control implements several interesting techniques, to include: Delegates, Properties, GDI+ and Overriding base methods. Special thanks, from the VB Community, to Jigar for his quick and positive response on my request to post this control in VB.NET.

The original Article for this control can be found on C-SharpCorner.com

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

blong
Web Developer
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

 
QuestionActiveX version Pin
Member 806659323-Nov-14 9:12
memberMember 806659323-Nov-14 9:12 
GeneralTick Marks fix Pin
spoogie22-Sep-07 16:05
memberspoogie22-Sep-07 16:05 
GeneralModification Pin
m1598118-Nov-06 12:59
memberm1598118-Nov-06 12:59 
GeneralVB.NET 2005 Pin
ultra029-Apr-06 17:11
memberultra029-Apr-06 17:11 
GeneralUpdate for some Value visualization.. Pin
woo_hoo15-Nov-05 20:31
memberwoo_hoo15-Nov-05 20:31 
Maybe it would be great to include in onPaint() these lines of code (after g.DrawImage(OffScreenImage,0,0);)

Font fnt = new Font(FontFamily.GenericSansSerif, 10, FontStyle.Regular);
g.DrawString(this.Value.ToString(), fnt, new SolidBrush(Color.FromArgb(80, 80, 80)), new PointF((rKnob.X + rKnob.Width / 2) - (g.MeasureString(this.Value.ToString(), fnt).Width / 2), (rKnob.Y + rKnob.Height / 2)));
QuestionC# version ? Pin
John H Long3-Dec-03 4:33
memberJohn H Long3-Dec-03 4:33 
AnswerRe: C# version ? Pin
blong4-Dec-03 13:59
memberblong4-Dec-03 13:59 
GeneralRe: C# version ? Pin
John H Long7-Dec-03 3:18
memberJohn H Long7-Dec-03 3:18 
GeneralRe: C# version ? Pin
Michal Brylka8-Feb-07 7:30
memberMichal Brylka8-Feb-07 7:30 
GeneralBug... Pin
Francois Germain17-Feb-03 16:33
memberFrancois Germain17-Feb-03 16:33 
GeneralRe: Bug... Pin
blong18-Feb-03 9:58
memberblong18-Feb-03 9:58 
GeneralRe: Bug... A fix of the cause of the error Pin
tntiger26-Sep-03 7:59
membertntiger26-Sep-03 7:59 
GeneralA couple of questions... Pin
Josh Martin12-Jul-02 13:31
memberJosh Martin12-Jul-02 13:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150731.1 | Last Updated 12 Jul 2002
Article Copyright 2002 by blong
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid