gpt4 book ai didi

c# - 当 Windows Shell 替换为 Windows Forms 应用程序时,第一次按键丢失

转载 作者:可可西里 更新时间:2023-11-01 14:37:10 24 4
gpt4 key购买 nike

我已按照 this SO question 中给出的方法成功替换了 Windows Shell .

但是,我检测到第一个按键丢失了,这对用户来说有点烦人。我们尝试过的解决方案是在OnShown事件中激活表单:

private void OnShownLoginForm(object z_sender, EventArgs z_e)
{
Activate();
m_loginTextBox.Focus();
}

但这并没有解决问题。你知道发生了什么事吗?

最佳答案

您可以尝试使用 System.Windows.Forms.SendKeys 类 ( MSDN Documentation ) 在表单加载事件中向表单发送按键事件。如果这没有帮助,请尝试在 Form.Shown 事件中发送键盘事件,因为 Form.Shown 是表单启动过程中的最后一个事件。

关于c# - 当 Windows Shell 替换为 Windows Forms 应用程序时,第一次按键丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7177330/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com