zoukankan      html  css  js  c++  java
  • 遍历panel 上的控件,然后操作

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using DevComponents.DotNetBar;
    using DevComponents.DotNetBar.Controls;

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

    private void btnAdd_Click(object sender, EventArgs e)
    {
    foreach(Control c in this.panelEx1.Controls)
    {
    if(c is DevComponents.DotNetBar.Controls.TextBoxX)
    {
    c.Text
    = "123";
    }
    else
    {
    c.Text
    = "名称!";
    }
    }
    }

    private void btnClear_Click(object sender, EventArgs e)
    {
    foreach(Control d in this.panelEx1.Controls)
    {
    if(d is DevComponents.DotNetBar.Controls.TextBoxX)
    {
    d.Text
    = "";
    }
    else
    {
    d.Text
    = "更改后的名称";
    }
    }
    }
    }
    }
    private void ClearText()
    {
    foreach (Control myControl in this.panelTable.Controls)
    {
    if (myControl is DevComponents.DotNetBar.LabelX)
    {
    continue;
    }

    myControl.Text
    = "";
    }
    }
  • 相关阅读:
    RSA算法
    本地CodeForces
    基于Giolite 多人开发
    DES算法
    MD5算法
    仓库库存管理系统(C+MySQL+ODBC)
    Spring源码解析(一)开篇
    JDK动态代理实现源码分析
    J.U.C Atomic(一)CAS原理
    JDK 注解详解
  • 原文地址:https://www.cnblogs.com/beeone/p/2012600.html
Copyright © 2011-2022 走看看