Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27348

VS 2010 [RESOLVED] Draw graphics on screen

$
0
0
I am using Visual Basic.Net and am drawing graphics on the screen.

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 Sub

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.

Viewing all articles
Browse latest Browse all 27348

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>