چرا نام لیبل با کلیک موس تغییر نمی کنه ؟ با تشکر
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Label l = new Label();// ساخت یک شی
l.Location = new Point(10, 10);// محل قرار گرفتن کنترل در فرم
l.Size = new Size(35, 15);//تعیین سایز برای شی
l.Text = "Label";// تعیین عنوان برای شی ساخته شده
Controls.Add(l);// اضافه کردن شی به فرم
}
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
l.Text = "Click";
}
}
}