Windows Focus

When i run my vb application ( a download manager) no matter which window i am on will lose focus, but still remain topmost, and then gain it back some time later.

i think my problems are somewhere in here:

Private Sub TimerC_Timer()
WantDown.Tag = ""
Open App.Path & "\data.xml" For Input Shared As #1
    Input #1, TEMPshowexit
    Input #1, TEMPshowclip
Close #1
        Static ClipboardText As String
          If Clipboard.GetFormat(vbCFText) = True And Clipboard.GetText <> ClipboardText Then
             
             ClipboardText = Clipboard.GetText
             If Trim$(Left$(ClipboardText, 7)) = "http://" Then
                'seems good address
                If WantDown.Tag = "" Then
                WantDown.Show
                If TEMPshowclip = 1 Then
                   Unload WantDown
                End If
                Else
                GoTo 2000
                End If
               
                WantDown.Tag = ""
                WantDown.Label2.Caption = ClipboardText
2000:
If TEMPshowclip = 1 Then GoTo 2001
                Do
                   DoEvents
                Loop Until WantDown.Tag <> ""
                WantDown.Hide
2001:
                If WantDown.Tag = "YES" Then
                  StartDownload ClipboardText
                End If
                Unload WantDown              
             End If
          End If

can anyone tell me if this is what is stealing focus from my other windows, and help me fix the problem?
boss302_lpAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
cjcujoConnect With a Mentor Commented:
I also do not see anthing in this code that would cause this.  You might want to stick "Me.SetFocus" in some spots so it will keep the focus on that form
0
 
Da_WeaselCommented:
doesnt look like anything in that code is causing it....mabye its in the StartDownload function?
0
 
boss302_lpAuthor Commented:
with ME.SetFocus does it require any other code, or components in the project?
0
 
cjcujoCommented:
It does not require and other code or components.
0
All Courses

From novice to tech pro — start learning today.