我有点问题。我有两个同时运行的应用程序,其中两个应用程序的TopMost窗口属性都设置为TRUE。
我正在努力寻找一个解决方案,以不断刷新对应用程序(B)的关注,因此它将保持在顶部,我的应用程序使用的是一个倒计时横幅,它应该一直放在应用程序(A)的顶部:
Public Class RebootWarning
Dim t As TimeSpan
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.TopMost = True
t = New TimeSpan(0, 1, 0)
Timer1.Interval = 1000
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
t -= New TimeSpan(0, 0, 1)
Label1.Text = t.ToString.Substring(3)
If t = New TimeSpan(0, 0, 0) Then
Timer1.Stop()
'MsgBox("Time out")
Process.Start("CMD")
End If
End Sub
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
End Sub端级
发布于 2020-04-01 17:54:36
所以,我找到了解决办法!最后,我添加并启用了一个额外的定时器,该定时器循环,然后在计时器完成时反复请求焦点。
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Focus()
Me.TopMost = True
End Subhttps://stackoverflow.com/questions/60950755
复制相似问题