zoukankan      html  css  js  c++  java
  • 取控件句柄

    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;
    using System.Diagnostics;

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

            p rivate void button1_Click(object sender, EventArgs e)
            {
                //IntPtr hwnd= Process.GetProcessById().MainWindowHandle;
                String str1 = null;
                str1 += "button1句柄:";
                str1+=button1.Handle.ToString();
                //str1 += "\r\n";
                str1 += Environment.NewLine;

                str1 += "checkbox1句柄:";
                str1 += checkBox1.Handle.ToString();
                //str1 += "\r\n";
                str1 += Environment.NewLine;

                str1 += "label1句柄:";
                str1 += label1.Handle.ToString();
                //str1 += "\r\n";
                str1 += Environment.NewLine;

                str1 += "radioButton1句柄:";
                str1 += radioButton1.Handle.ToString();
                //str1 += "\r\n";
                str1 += Environment.NewLine;

                textBox1.Text = str1;
            }


        }
    }
     

    源代码下载

  • 相关阅读:
    合并区间
    判断字符串是否是IP
    Python -- 异常处理
    python -- 双下方法
    python -- 判断函数和方法
    python -- 面向对象:反射
    Python -- 面向对象:类的成员
    Python -- 面向对象:类的约束
    Python -- 面向对象的三大特性及深入了解super()
    Python -- mro算法
  • 原文地址:https://www.cnblogs.com/hackpig/p/1668479.html
Copyright © 2011-2022 走看看