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;
            }


        }
    }
     

    源代码下载

  • 相关阅读:
    numpy
    shell进阶2
    python笔记3
    shell进阶1
    记录:Paxos原理、历程及实战
    收藏
    linux fs io
    linux mount 操作
    docker好文收藏
    rbd snap(1)
  • 原文地址:https://www.cnblogs.com/hackpig/p/1668479.html
Copyright © 2011-2022 走看看