I am trying to create a circle on a screen from code and have the user change the color of the circle by using Scroll controls to assign values to A, R, G, and B in the Color.FromArgb(A, R, G, B) expression.
I would like to assign Rcolor = Color.FromArgb(A, R, G, B).
Here is my code snippet:
Public Sub MakeCircle ()
Dim ShowCircles As Graphics
Dim PenColorR As New Pen(Color.Red)
ShowCircles = Me.CreateGraphics
ShowCircles.DrawEllipse(PenColorR, 430 - AdjSepH, 450, 68, 86)
The above code actually works, creating a red circle on the screen.
This also works:
Dim PenColorR As New Pen(Color.FromArgb(255, 255, 0, 0))
BUT, if I try to assign FromArgb to a variable like so, error messages are triggered...
<br />
Dim Rcolor As Color = Color.FromArgb(255, 255, 0, 0)<br />
Dim PenColorR As New Pen(Color.Rcolor)
Or
Dim PenColorR As New Pen(Rcolor)
So is there way to assign Color.FromArgb(255, 255, 0, 0) to a variable (Rcolor) and use to color the graphics???
Hope this question is clear!!
Thanks
Gary Vogel