AdvancedHMI Software
General Category => Support Questions => Topic started by: DavidSr on September 25, 2019, 06:08:17 AM
-
I was looking at the code for the Compact Gauge and I see the code for band colors is not in there so I am guessing it is in another file??? a dll?
Anyway I was going to try to add another band. If anyone has the time Can you direct me somewhere to find out how to do that? I would like to add a 4th band.
Thank you!
-
You will need to override the OnPaint method and add additional drawing commands using GDI+. For example, to make and extended version of the gage, create a new class as such:
Public Class CompactGageEx
Inherits GaugeCompact
Protected Overrides Sub OnPaint(e As PaintEventArgs)
MyBase.OnPaint(e)
e.Graphics.DrawArc(Pens.White, 1, 1, 10, 100, 0, 50)
e.Graphics.DrawLine(Pens.Violet, 0, 0, Me.Width, Me.Height)
End Sub
End Class