الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كيفية حذف جميع Labels بزر واحد

بدأه Haitham242 في 6 مايو 2014 · 2 رد · 470 مشاهدة · في Microsoft Visual C#.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

   I have created Labels . the problem that i want them to be overwinter or removed and the new labels that the new information just  appearing> 

 

 

 

 for (int i = 0; i < 1; i++)
                {
 
                    xCoor = coor.Next(0, 750);
                    yCoor = coor.Next(0, 500);
 
                    Label nodeLabel = new Label();
                    nodeLabel.Text = x + " : " + xCoor + "," + yCoor;
                    nodeLabel.AutoSize = true;
                    nodeLabel.Location = new Point(xCoor + 10, yCoor + 5);
                    picNodes.Controls.Add(nodeLabel);
                  }
#3
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace testLabelsinApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
ContolsInApplication.ClearLabels(this);
}

}

class ContolsInApplication
{
public static void ClearLabels(Form f)
{
foreach(Control c in f.Controls)
{
if(c is Label)
{
c.Visible = false;
}
}
}
}
}

 

تم تعديل هذه المشاركة بواسطة #Exp.C في 16 مايو 2014 في 01:03

مواضيع مشابهة