Advertisement
Guest User

no5

a guest
Jun 14th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class Form1
  2.  
  3.     Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  4.         Me.AutoSize = True : Me.Text = "Graph by Your ID"
  5.         PictureBox1.Top = 0 : PictureBox1.Left = 0
  6.         PictureBox1.Width = 500 : PictureBox1.Height = 500
  7.         Button1.Text = "Draw" : Button1.Font = New Font("Courier", 20)
  8.         Button1.Width = 100 : Button1.Height = 50
  9.         Button1.Top = 10 : Button1.Left = PictureBox1.Width + 50
  10.     End Sub
  11.  
  12.     Private Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
  13.         Dim myGraph As Graphics = PictureBox1.CreateGraphics
  14.         Dim myPen1, myPen2, myPen3 As Pen
  15.         Dim id, ang, bigR, x1, y1 As Single
  16.         Dim mybrush, mybrush1 As Brush
  17.  
  18.         myPen1 = New Pen(Color.Blue, 5) : myGraph.DrawRectangle(myPen1, 0, 0, 500, 500)
  19.         myPen2 = New Pen(Color.Gray, 1)
  20.         myPen3 = New Pen(Color.White, 6)
  21.         mybrush = New SolidBrush(Color.White)
  22.         mybrush1 = New SolidBrush(Color.Gray)
  23.  
  24.  
  25.  
  26.         For x1 = 0 To 500 Step 50
  27.             For y1 = 0 To 500 Step 50
  28.                
  29.                 If ((x1 + y1) Mod 100) = 0 Then
  30.  
  31.                     myGraph.FillRectangle(mybrush1, x1, y1, 50, 50)
  32.                 End If
  33.  
  34.             Next
  35.         Next
  36.  
  37.         myGraph.DrawRectangle(myPen1, 0, 0, 500, 500)
  38.        
  39.  
  40.     End Sub
  41. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement