|
Public Class Form1
Inherits System.Windows.Forms.Form Vom Windows Form Designer generierter Code
Private Declare Function GetDC Lib "user32" Alias _
"GetDC" (ByVal hwnd As Integer) As IntPtr
Private Declare Function ReleaseDC Lib "user32" Alias _
"ReleaseDC" (ByVal hwnd As Integer, ByVal hdc _
As IntPtr) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim RedPen As New Pen(Color.Red, 50)
Dim GreenPen As New Pen(Color.GreenYellow, 50)
Dim dc As IntPtr
Dim g As Graphics
Dim i As Integer
Dim waW, waH As Long
waW = Screen.PrimaryScreen.WorkingArea.Width
waH = Screen.PrimaryScreen.WorkingArea.Height
dc = GetDC(0)
g = Graphics.FromHdc(dc)
g.DrawLine(RedPen, 10, 10, waW - 10, waH - 10)
g.DrawLine(GreenPen, waW - 10, 10, 10, waH - 10)
g.DrawString("VB-fun", New Font("Comic Sans Ms", 70), _
New SolidBrush(Color.DarkBlue), waW / 3, waH / 2)
g.Dispose()
ReleaseDC(0, dc)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button2.Click
Dim f2 As New Form2()
f2.Show()
Me.Close()
End Sub
End Class
|
|