473,326 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

question on focus

Hi All,
Is it possible to find which object (textbox,listview etc) has the focus without testing each
and every object on the form.

Thank You.
May 10 '06 #1
1 1114
There isn't a one-call way of doing this.
What you can do though is to start from the form's ActiveControl and follow
your way up until your find a control that is not a ContainerControl or a
contianer control's ActiveControl property is *null*.
The last control you find (that is not a container or its activecontrol is
*null*) has the focus.
--
HTH
Stoitcho Goutsev (100)

<Co**********@al.com> wrote in message
news:11****************@echo.uk.clara.net...
Hi All,
Is it possible to find which object (textbox,listview etc) has the
focus without testing each
and every object on the form.

Thank You.

May 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Dave | last post by:
Hi, With this code, I thought that any 'click' with the mouse would be captured on the window level and nothing would happen, but a click on the button triggers nevertheless the function hit()....
1
by: Paul Tsai | last post by:
Dear All, I used csharp web form to develop my company web application, and my question is how shuld I do if I want to focus on my textbox(ex. like Java Script form.txtID.focus()). Thanks !!...
4
by: Christian Ista | last post by:
Hello, I have 2 questions : 1. On an ASP.NET page I have several controls (5 TextBox, 1 Dropdown and 1 button) Only the dropdown is AutoPostBack = true, the TextBox are SingleLine When I...
6
by: Mike | last post by:
I have a few textbox controls that have autopostback so that when they loose focus they update a label control that shows the count of characters in their respective text control. This works fine,...
3
by: Joe Delphi | last post by:
Hi, I have more experience working with Windows.Forms than with WebForms and sometimes it trips me up. When my page loads, I want a particular textbox to have the focus. I am attempting to...
2
by: joe | last post by:
Question about javascript -> onblur='self.focus' I use the method <body onblur='self.focus'> to keep the child browser always on the top , it success, but the textbox inside the child browser can...
4
by: Ron | last post by:
Hi all, Is there any way to make a particular tab have the focus without actually clicking on it? I know there's a On Mouse Move, but if I put in code to have that specific tab receive the...
2
by: Sid Price | last post by:
Is there a way of stopping a form getting focus in VB.NET. The scenario I have is a main form and a form used for display only. There are no user controls on the display form and it does not ever...
10
by: blaine | last post by:
Hey everyone! I'm not very good with Tk, and I am using a very simple canvas to draw some pictures (this relates to that nokia screen emulator I had a post about a few days ago). Anyway, all is...
1
by: john ciriello | last post by:
I created a form and put a button and a label on it. I set the tabstops to false. When I first run it I can click the button and there is no focus rectangle. Which is what I want. However, if I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.