ايران ويج

نسخه‌ي كامل: shape و line
شما هم اكنون متن قالب بندي نشده را مي‌بينيد.مشاهده‌ي نسخه‌ي اصلي
سلام.
تو ویبی 2 تا کنترل به نام های shape و line تو جعبه ابزار بود. ولی تو دات نت این ابزار ها موجود نیست. من چطور میتونم شیپ و لاین ایجاد کنم؟
توی دات نت باید با +GDI واسه ترسیم اشکال کار کنی البته یه کنترل جالب دیدم که همین کار رو کپسوله میکنه تو دات نت :

http://blogs.vbcity.com/mcintyre/archive.../8760.aspx
از MSDN :
دو روش برای کشیدن خط:
کد PHP:
' Visual Basic 2005
Using Label controls.
Private 
Sub Form1_Load(ByVal sender As System.Object_
ByVal e 
As System.EventArgsHandles MyBase.Load
    Dim Line1 
As New System.Windows.Forms.Label
    Dim Line2 
As New System.Windows.Forms.Label
    
' Draw a horizontal line 14 pixels from the top of the form.
    Line1.Location = New System.Drawing.Point(0, 14)
    Line1.Size = New System.Drawing.Size(Me.Width, 1)
    Line1.BorderStyle = BorderStyle.None
    Line1.BackColor = System.Drawing.Color.Red
    Line1.Text = ""
    Controls.Add(Line1)
    ' 
Draw a vertical line 14 pixels from the left of the form.
    
Line2.Location = New System.Drawing.Point(140)
    
Line2.Size = New System.Drawing.Size(1Me.Height)
    
Line2.BorderStyle BorderStyle.None
    Line2
.BackColor System.Drawing.Color.Blue
    Line2
.Text ""
    
Controls.Add(Line2)
End Sub 

کد PHP:
' Visual Basic 2005
Private Sub FormPaint(ByVal sender As Object, _
ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
    ' 
Draw a diagonal line from the top left to the lower right.
    
e.Graphics.DrawLine(Pens.Black00Me.ClientSize.Width_
    Me
.ClientSize.Height)
End Sub 

و دو روش برای رسم شکل:
اولی فقط مربع و مستطیل
کد PHP:
' Visual Basic 2005
Using a Label control
Private Sub Form2_Load(ByVal sender As System.ObjectByVal e As _
System
.EventArgsHandles MyBase.Load
    Dim Shape1 
As New System.Windows.Forms.Label
     Show a solid red rectangle 14 pixels from the top left
.
    
Shape1.Location = New System.Drawing.Point(1414)
    
Shape1.Size = New System.Drawing.Size(200100)
    
Shape1.BorderStyle BorderStyle.None
    Shape1
.BackColor System.Drawing.Color.Red
    Shape1
.Text ""
    
Controls.Add(Shape1)
End Sub 

کد PHP:
' Visual Basic 2005
Private Sub Form3_Paint(ByVal sender As Object, ByVal e As _
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
    ' 
Draw a 70 pixel diameter red circle.
    
e.Graphics.DrawEllipse(Pens.Red007070)
End Sub 

ولی خداییش بعضی وقتا این MSDN چه روشایی پیشنهاد میده.
سلام.
ممد لینکتو هر کاری کردم باز نشد. میشه فایل رو آپ کنی.
آدرس اصلي