วันศุกร์ที่ 16 มกราคม พ.ศ. 2552

Draw Rectangle With VB.NET





' VB.NET DrawRectangle Source Code

Option Explicit On
Option Strict On

Public Class Form1

Dim rRectangle As Rectangle
Dim vPen As Pen

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Text = " Draw Rectangle With VB.NET "
Me.BackColor = Color.Yellow
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.SizableToolWindow
rRectangle = New Rectangle(10, 10, 150, 150)
vPen = New Pen(Color.Red, 10)
End Sub

Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
e.Graphics.DrawRectangle(vPen, rRectangle)
vPen = New Pen(Color.Teal, 20)
e.Graphics.DrawRectangle(vPen, 70, 70, 200, 200)
vPen = New Pen(Color.Snow, 15)
e.Graphics.DrawRectangle(vPen, 100, 100, 180, 180)
End Sub
End Class

' Design VB.NET Source Code Games By Fernando Firaht

ไม่มีความคิดเห็น:

แสดงความคิดเห็น