S
Steve
Hi all
I am using the following code to draw strings onto a Form:
----------------------------
Dim tabGraphics As System.Drawing.Graphics = Me.CreateGraphics()
Dim labelFont As New Font("Verdana", 12, FontStyle.Regular, GraphicsUnit.Pixel)
Dim solidBrush As New SolidBrush(Color.DarkSlateBlue)
---------------------------
My question is, Is there a way that I can align the string that I am drawing to the right? When I draw the string it obviously writes it onto the form, but the strings are variable lengths and I want to align them to the right as if they were in a Label control with the TextAlign set to MiddleRight.
Also, is there a way that I can get a control on the form by using it's name? I know that I have a control named "tabMain" which is a tab control, can I get the object so I can add to the controls collection? I would like something like:
Dim c as Control = "tabMain"
c.Controls.Add(myControl)
Thanks for any help,
Kind regards,
Steve.
I am using the following code to draw strings onto a Form:
----------------------------
Dim tabGraphics As System.Drawing.Graphics = Me.CreateGraphics()
Dim labelFont As New Font("Verdana", 12, FontStyle.Regular, GraphicsUnit.Pixel)
Dim solidBrush As New SolidBrush(Color.DarkSlateBlue)
---------------------------
My question is, Is there a way that I can align the string that I am drawing to the right? When I draw the string it obviously writes it onto the form, but the strings are variable lengths and I want to align them to the right as if they were in a Label control with the TextAlign set to MiddleRight.
Also, is there a way that I can get a control on the form by using it's name? I know that I have a control named "tabMain" which is a tab control, can I get the object so I can add to the controls collection? I would like something like:
Dim c as Control = "tabMain"
c.Controls.Add(myControl)
Thanks for any help,
Kind regards,
Steve.