jhylands

Drawing an eclips first attempt

Aug 11th, 2012
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.85 KB | None | 0 0
  1. Imports System.Drawing
  2. Imports System.Drawing.Drawing2D
  3. Imports System.Windows.Forms
  4. Public Class Form1
  5.  
  6.     Private Sub BRun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BRun.Click
  7.         Dim a As Graphics
  8.         Dim mypen As Pen
  9.         Dim myrect As RectangleF
  10.  
  11.         mypen = New Pen(System.Drawing.Color.Red, 6)
  12.  
  13.         a = Me.CreateGraphics
  14.         a.Clear(Me.BackColor)
  15.         a.DrawEllipse(mypen, 100, 100, 50, 50)
  16.  
  17.         myrect.Width = 250
  18.         myrect.X = 300
  19.         myrect.Y = 10
  20.         myrect.Height = 100
  21.         a.DrawEllipse(mypen, myrect)
  22.  
  23.  
  24.  
  25.         a.Dispose()
  26.         mypen.Dispose()
  27.     End Sub
  28.  
  29.     Private Sub BExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BExit.Click
  30.         End
  31.     End Sub
  32.     Public Shared Sub Main()
  33.         Application.Run(New Form1)
  34.     End Sub
  35. End Class
Advertisement
Add Comment
Please, Sign In to add comment