[RESOLVED] Clear - Focus on a ToolStrip Button-VBForums
Results 1 to 3 of 3

Thread: [RESOLVED] Clear - Focus on a ToolStrip Button

  1. #1

    Thread Starter
    Addicted Member sinner0636's Avatar
    Join Date
    Sep 2009
    Posts
    233

    Resolved [RESOLVED] Clear - Focus on a ToolStrip Button

    Hello im having a bit of a problem i do a large process in a toolstrip buttons click event and the button has blue focus on until i click something on the form any ideas how to get remove this focus i cant put the functions in a timer because my app locks up because its waiting from the process to finish to add the items to the listview any ideas? thanks

    Code:
       'Process Items
    
        Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
            ListView1.Items.Clear()
            ItemCount = 0
            RemovedCount = 0
            CancelScan = False
            ScanAgn.Visible = False
    
            Call ProcessJunkFiles(Me.ListView1, GetHardDrives)
            Call ProcessSpecialFolders(Me.ListView1)
        End Sub

    Name:  Scanner.jpg
Views: 166
Size:  18.3 KB
    Last edited by sinner0636; Dec 21st, 2017 at 07:55 AM.

  2. #2
    Hyperactive Member
    Join Date
    Sep 2017
    Posts
    409

    Re: Clear - Focus on a ToolStrip Button

    Quick guess here...
    will
    Code:
     Me.ActiveControl = Nothing
    Solve this?

  3. #3

    Thread Starter
    Addicted Member sinner0636's Avatar
    Join Date
    Sep 2009
    Posts
    233

    Re: Clear - Focus on a ToolStrip Button

    i figured out a work around i had the code in the clicked event so i put it in the mouse down event this made the button lock up still a little tiny delay but a lot better then it was

    Code:
     'tool scan
        Private Sub ToolStripButton1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ToolStripButton1.MouseDown
            ListView1.Items.Clear()
            ItemCount = 0
            RemovedCount = 0
            CancelScan = False
            ScanAgn.Visible = False
            Timer1.Enabled = True
            Call ProcessJunkFiles(Me.ListView1, GetHardDrives)
            Call ProcessSpecialFolders(Me.ListView1)
        End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width