سلام بر برنامه نویسان عزیز ایران زمین 😉 در این مطلب آموزش رسم خط با Graphics و Pen و متد DrawLine در #C را آماده کردم. انشاالله که این آموزش برای شما مفید باشد.
خروجی این کد:
کد رسم خط با Graphics و Pen و متد DrawLine در #C :
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
public class DrawLineDemo : System.Windows.Forms.Form
{
public DrawLineDemo()
{
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(400, 400);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.DrawLineDemo_Paint);
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
public class DrawLineDemo : System.Windows.Forms.Form
{
public DrawLineDemo()
{
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(400, 400);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.DrawLineDemo_Paint);