Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27346

VS 2010 Form lose focus - exit?

$
0
0
Hey.

I've made a little handy tool that what it does is when I use ctrl + 1, it will open a new form which is almost invisible and will focus on the textbox. When you write something
and press enter, it will automatically go into google and search it. (I have one for YouTube too). Now.. I'm facing 2 problems.

1. I'm using the KeyDown event on my textbox, and when I use "ElseIf e.KeyCode = Keys.Escape", when I press Escape there's a beep sound but nothing happens. How can I fix that?
2. I want to close this form when it loses focus, so I used the LostFocus on my main form, but it doesn't work. I want it to close the form in any way of losing focus, if it's minimizing, clicking
somewhere else, moving to another active window, everything. How can I do that?

Viewing all articles
Browse latest Browse all 27346

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>