Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Blue_Click(Index As Integer)
- Form1.ForeColor = vbBlue
- End Sub
- Private Sub full_Click()
- Form1.WindowState = FormWindowState.Maximized
- End Sub
- Private Sub Default_Click(Index As Integer)
- Form1.ForeColor = vbBlack
- End Sub
- Private Sub opsiGreen_Click(Index As Integer)
- Form1.ForeColor = vbGreen
- End Sub
- Private Sub opsiRed_Click(Index As Integer)
- Form1.ForeColor = vbRed
- End Sub
- Sub garis(x1, y1, x2, y2)
- dx = x2 - x1
- dy = y2 - y1
- If x2 < x1 And y2 < y1 Then
- dx = x1 - x2
- dy = y1 - y2
- End If
- If x2 < x1 And y2 = y1 Then
- dx = x1 - x2
- End If
- If y2 < y1 And x2 = x1 Then
- dy = y1 - y2
- End If
- If dx > dy Then
- l = dx
- Else
- l = dy
- End If
- If x2 < x1 And y1 = y2 Then
- dx = dx - 2 * dx
- End If
- If y2 < y1 And x1 = x2 Then
- dy = dy - 2 * dy
- End If
- If dx = 0 Then
- incx = 0
- Else
- incx = dx / l
- End If
- If dy = 0 Then
- incy = 0
- Else
- incy = dy / l
- End If
- x = x1
- y = y1
- If x2 < x1 And y2 < y1 Then
- x = x2
- y = y2
- End If
- For i = 1 To l
- Form1.PSet (x, y)
- x = x + incx
- y = y + incy
- Next i
- End Sub
- Private Sub sumbuX_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- Form1.Cls
- Form1.PSet (sumbuX, sumbuY)
- Form1.PSet (sumbuX, sumbuY + 2)
- Form1.PSet (sumbuX, sumbuY - 2)
- Form1.PSet (sumbuX - 2, sumbuY)
- Form1.PSet (sumbuX + 2, sumbuY)
- End If
- End Sub
- Private Sub sumbuX1_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- x1 = Int(sumbuX1.Text)
- y1 = Int(sumbuY1.Text)
- x2 = Int(sumbuX2.Text)
- y2 = Int(sumbuY2.Text)
- Form1.Cls
- Call garis(x1, y1, x2, y2)
- End If
- End Sub
- Private Sub sumbuX2_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- x1 = Int(sumbuX1.Text)
- y1 = Int(sumbuY1.Text)
- x2 = Int(sumbuX2.Text)
- y2 = Int(sumbuY2.Text)
- Form1.Cls
- Call garis(x1, y1, x2, y2)
- End If
- End Sub
- Private Sub sumbuY_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- Form1.Cls
- Form1.PSet (sumbuX, sumbuY)
- Form1.PSet (sumbuX, sumbuY + 2)
- Form1.PSet (sumbuX, sumbuY - 2)
- Form1.PSet (sumbuX - 2, sumbuY)
- Form1.PSet (sumbuX + 2, sumbuY)
- End If
- End Sub
- Private Sub sumbuY1_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- x1 = Int(sumbuX1.Text)
- y1 = Int(sumbuY1.Text)
- x2 = Int(sumbuX2.Text)
- y2 = Int(sumbuY2.Text)
- Form1.Cls
- Call garis(x1, y1, x2, y2)
- End If
- End Sub
- Private Sub sumbuY2_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- x1 = Int(sumbuX1.Text)
- y1 = Int(sumbuY1.Text)
- x2 = Int(sumbuX2.Text)
- y2 = Int(sumbuY2.Text)
- Form1.Cls
- Call garis(x1, y1, x2, y2)
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment