I have a little Task entry application that I wrote for me and my colleagues to track completed tasks throughout the day. The application stays positioned at the top of the screen and has it's height=30px and opacity=25%. When the user mouses over the form, it expands and opacity changes to 100%:
The problem that I have, is that if you're using another application (say IE for example), and then Mouse over the Task app, it expands and sets the focus to txtActivity as expected. However, the prior application remains activated. So if you begin typing (expecting to enter text into txtActivity), the keystrokes are sent to IE window, not the Task application.
Any ideas how to stop this and actually activate the Task form on mouse hover?
mwa
<><
Code:
Private Sub Form1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseHover
Dim intX As Integer = Screen.PrimaryScreen.Bounds.Width
Me.Width = 260
Me.Height = 140
Me.Left = (intX / 2) - (Me.Width / 2)
Me.Top = 0
Me.Opacity = 1
Me.Activate()
End Sub
Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
txtActivity.Focus()
End Sub
The problem that I have, is that if you're using another application (say IE for example), and then Mouse over the Task app, it expands and sets the focus to txtActivity as expected. However, the prior application remains activated. So if you begin typing (expecting to enter text into txtActivity), the keystrokes are sent to IE window, not the Task application.
Any ideas how to stop this and actually activate the Task form on mouse hover?
mwa
<><