The following code causes a string to be written vertically on a form. The code runs automatically when the form is opened.
I would like to put the code in a simple little sub routine that would be called when the form loads or a button clicked, etc.
I've tried every whichway to get rid of the "e" component which I assume is tied to an event. I don't want the code to run directly from an event.
How the heck do I do that.
Thanks,
Ted
Code:
Public Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As PaintEventArgs) Handles MyBase.Paint
Dim sName As String = "TedN"
With [B]e[/B].Graphics
Dim oBrush As New SolidBrush(Color.Black)
Dim oFont As New Font("Tahoma", 32, FontStyle.Bold)
Dim oStrFormat As New StringFormat(StringFormatFlags.DirectionVertical)
.DrawString(sName, oFont, oBrush, 0.0F, 0.0F, oStrFormat)
End With
End Sub
I would like to put the code in a simple little sub routine that would be called when the form loads or a button clicked, etc.
I've tried every whichway to get rid of the "e" component which I assume is tied to an event. I don't want the code to run directly from an event.
How the heck do I do that.
Thanks,
Ted