Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
- Me.AutoSize = True : Me.Text = "Graph by Your ID"
- PictureBox1.Top = 0 : PictureBox1.Left = 0
- PictureBox1.Width = 500 : PictureBox1.Height = 500
- Button1.Text = "Draw" : Button1.Font = New Font("Courier", 20)
- Button1.Width = 100 : Button1.Height = 50
- Button1.Top = 10 : Button1.Left = PictureBox1.Width + 50
- End Sub
- Private Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
- Dim myGraph As Graphics = PictureBox1.CreateGraphics
- Dim myPen1, myPen2, myPen3 As Pen
- Dim id, ang, bigR, x1, y1 As Single
- Dim mybrush, mybrush1 As Brush
- myPen1 = New Pen(Color.Blue, 5) : myGraph.DrawRectangle(myPen1, 0, 0, 500, 500)
- myPen2 = New Pen(Color.Gray, 1)
- myPen3 = New Pen(Color.White, 6)
- mybrush = New SolidBrush(Color.White)
- mybrush1 = New SolidBrush(Color.Gray)
- For x1 = 0 To 500 Step 50
- For y1 = 0 To 500 Step 50
- If ((x1 + y1) Mod 100) = 0 Then
- myGraph.FillRectangle(mybrush1, x1, y1, 50, 50)
- End If
- Next
- Next
- myGraph.DrawRectangle(myPen1, 0, 0, 500, 500)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement