隐藏光标与获得光标2----获得光标所在的控件
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.Runtime.InteropServices;
namespace 获得当前拥有焦点的控件
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        [DllImport("user32.dll", EntryPoint = "GetFocus")]
        public extern static IntPtr GetF222ocus(); 
        private void button1_Click(object sender, EventArgs e)
        {
            IntPtr currnetGetFocusedControl = GetF222ocus();
            Control control = Control.FromHandle(currnetGetFocusedControl);
        }
    }
}
    龙腾一族至尊龙骑
 
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号