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 WindowsFormsApplication28
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
protected override void WndProc(ref Message m)
{
const int WM_CHAR = 0x0102;
const int WM_USER = 0x0400;
const int WM_USER1 = WM_USER + 1;
switch (m.Msg)
{
case WM_USER1:

这篇博客介绍了如何使用C#创建一个WinForm应用,模拟QQ聊天界面的功能,当在textbox1中输入字符时,焦点会自动切换到textbox2。通过重写WndProc方法,拦截WM_CHAR消息,并利用WinAPI的SendMessage方法实现焦点切换。
最低0.47元/天 解锁文章
176

被折叠的 条评论
为什么被折叠?



