AdvancedHMI Software
General Category => Feature Request => Topic started by: Morgan on May 12, 2016, 11:01:08 AM
-
Is there a way to change the GraphicIndicator's text color? If the graphic is dark you cannot see the black text.
-
Use the ForeColor property set the Text color
-
You can change the control's Font ForeColor to anything and it works but as soon as the Form is reloaded the text color changes back to Black. The control's Font ForeColor is still the color that was set.
When you first create the control the font color is the same as the parent Form. If you ever change it then it will always be black when the Form is loaded.
-
This is a confirmed bug. Fortunately there is an easy work around.
- Go to Solution Explorer and expand down the AdvancedHMIControls project
- Under that project, open the GraphicIndicator.vb file
- Scroll all the way to the bottom and paste the following code just one line above "End Class"
Protected Overrides Sub OnForeColorChanged(e As System.EventArgs)
MyBase.OnForeColorChanged(e)
If TextBrush Is Nothing Then
TextBrush = New SolidBrush(MyBase.ForeColor)
Else
TextBrush.Color = MyBase.ForeColor
End If
Me.Invalidate()
End Sub