B
billsahiker
There is a code example in the MS Training Kit for the Framework 2.0
test that does not seem to work. The example has just three lines of
code, but does not indicate where to put the code, so I put it in the
form.load event and it generates a blank screen, but is supposed to
display "Hello World" on the form. Then I put it in the paint event
as shown below and still I get a blank form when it runs. Any ideas
what is wrong? I previously posted here and was given another way of
accomplishing the task -that is not the point as I am studying for the
exam and need to know how to make this code work, or find out if it
has an error or something missing.
Public Class Form1
Private Sub Form1_Paint(ByVal sender as Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim g as Graphics = me.CreateGraphics
Dim f as Font = New Font("Arial", 12, FonstStyle.Bold)
g.Drawstring("Hello World", f, Brushes.Blue, 10, 10)
End Sub
End Class
test that does not seem to work. The example has just three lines of
code, but does not indicate where to put the code, so I put it in the
form.load event and it generates a blank screen, but is supposed to
display "Hello World" on the form. Then I put it in the paint event
as shown below and still I get a blank form when it runs. Any ideas
what is wrong? I previously posted here and was given another way of
accomplishing the task -that is not the point as I am studying for the
exam and need to know how to make this code work, or find out if it
has an error or something missing.
Public Class Form1
Private Sub Form1_Paint(ByVal sender as Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim g as Graphics = me.CreateGraphics
Dim f as Font = New Font("Arial", 12, FonstStyle.Bold)
g.Drawstring("Hello World", f, Brushes.Blue, 10, 10)
End Sub
End Class