Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Finding the focus

Posted on 2006-10-25
2
Medium Priority
?
276 Views
Last Modified: 2010-04-23
Hello,

I am trying to write some code that will evaluate where the focus is currently with a true/false.  something like this.....

If textbox1.focus = true then
end if

The above will not work for me though, any ideas?

Thanks!

-Navicerts
0
Comment
Question by:Navicerts
2 Comments
 
LVL 17

Accepted Solution

by:
ZeonFlash earned 2000 total points
ID: 17806742
Try using the form's ActiveControl property:

If textbox1 Is Me.ActiveControl Then
End If
0
 
LVL 7

Author Comment

by:Navicerts
ID: 17806856
That worked great, thank you!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question