显示表格而不会失去焦点 [英] Show Form Without losing Focus

查看:66
本文介绍了显示表格而不会失去焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建带有通知的Messenger(类似于MSN).

如何显示通知窗口,而又不会失去对活动表单的关注?

我尝试过了

I am creating a messenger with a notification(MSN like).

How Can i show a notification windows without losing my focus on my active form?

i tried this

Private Declare Function ShowWindow Lib "user32" (ByVal handle As IntPtr, ByVal nCmdShow As Integer) As Integer

Private Const SW_SHOWNA As Integer = 4

Private Sub ShowForm()
    ShowWindow(Me.Handle, SW_SHOWNA)
End Sub



还有这个



and this

Protected Overrides ReadOnly Property ShowWithoutActivation() As Boolean
        Get
            Return True
        End Get
End Property


但是它们都不起作用.

每次弹出通知窗口时,我总是会失去对活动表单的关注.

谢谢.


But none of them working.

Everytime a notification windows pop up, i always lost my focus on my active form.

Thanks.

推荐答案

我想您想做的是弹出通知,然后将焦点返回到活动窗口.
I imagine what you want to do, is pop up your notification, then return focus to your active window.


这篇关于显示表格而不会失去焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆