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
    = "";
    }
    }
  • 相关阅读:
    面试总结
    java高级开发
    idea的快捷键
    微服务面试题目
    windows下jenkins的安装与配置
    微服务面试集合
    springlcoud中使用consul作为注册中心
    乐观锁和悲观锁
    volatile与synchronized的区别
    Java CAS 和ABA问题
  • 原文地址:https://www.cnblogs.com/beeone/p/2012600.html
Copyright © 2011-2022 走看看