Results 1 to 3 of 3

Thread: StatusStrip/ToolStrip Events

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2009
    Posts
    19

    StatusStrip/ToolStrip Events

    I've got a StatusStrip...and I'm trying to initialize some code when it gets focus...so clicking on it should give focus to it right? I've tried the following code:
    VB 2008 Code:
    1. Private Sub StatusStrip_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StatusStrip.Enter
    2.         MessageBox.Show("Wooh!")
    3.     End Sub
    VB 2008 Code:
    1. Private Sub StatusStrip_GotFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StatusStrip.GotFocus
    2.         MessageBox.Show("Wooh!")
    3.     End Sub

    The messagebox is just there to let me know it actually worked...but it isn't working...the messagebox isn't showing when I click on the StatusStrip, even when I'm sure it doesn't already have focus...suggestions?

    Thanks.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: StatusStrip/ToolStrip Events

    A StatusStrip control cannot receive focus. What are you actually trying to achieve?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2009
    Posts
    19

    Re: StatusStrip/ToolStrip Events

    Damn...I just need to initialize some code when I click on the status strip...I think you replied to my other thread...where I stated the first click didn't take effect...because I have some buttons on the StatusStrip which I need to work in one click...but the first click removes focus from the currently focus form, and the second click actually works...I need to be able to click the buttons and have them work in one click...it seems to only be anything located on the StatusStrip that needs two clicks...I can instantly activate controls on other forms in one click even when they don't have focus...but not the StatusStrip control...

    EDIT: Basically...what I need, is a way to detect when I first click on the StatusStrip...

    PS - I've tried using the mousehover event and then using StatusStrip.select(), but it can cause undesired results...like when the use is typing something in another form, and the mouse accidentally moves over the StatusStrip...
    Last edited by PSYCHONAUT; Jan 15th, 2010 at 02:41 AM.

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width