I am using Visual Basic.Net and am drawing graphics on the screen.
Here is my code:
In the above code, text is drawn on the screen. My question is this: How can I remove the text that is drawn to screen? I see that there is a .Clear method, however, this 'Clears the entire drawing surface and fills it with the specified background color', rather than just removing the drawn text.
Thanks in advance.
Here is my code:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim gr As Graphics = Graphics.FromHwnd(New IntPtr(0))
gr.DrawString("text on screen", New Font(Me.Font.FontFamily, 25, FontStyle.Regular), Brushes.Red, 50, 50)
End SubThanks in advance.