473,725 Members | 2,197 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pointer on focused control

Dear all,
if I have a Form and some controls on it, how can I get a pointer to the
focused control. I what to remember focused control, do some operations and
then restore focus
Nov 21 '05 #1
3 1609
"Boni" <oilia@nospam > schrieb:
if I have a Form and some controls on it, how can I get a pointer to the
focused control. I what to remember focused control, do some operations
and then restore focus


The form's 'ActiveControl' property returns the currently focused control.
You can set the focus to a control by calling its 'Focus' method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
Thank you.
Can I somehow get from the control, the form, on which it is situated? The
control is incapsulated and I have no pointer there.I would have to pass one
more parameter if it is not possible to get parent form from the control.

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> schrieb im Newsbeitrag
news:O7******** *****@TK2MSFTNG P14.phx.gbl...
"Boni" <oilia@nospam > schrieb:
if I have a Form and some controls on it, how can I get a pointer to the
focused control. I what to remember focused control, do some operations
and then restore focus


The form's 'ActiveControl' property returns the currently focused control.
You can set the focus to a control by calling its 'Focus' method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
"Boni" <oilia@nospam > schrieb:
Can I somehow get from the control, the form, on which it is situated?


\\\
Dim f As Form = c.FindForm()
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #4

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

Similar topics

7
1986
by: Wolfgang Jeltsch | last post by:
Hello, say, I have a class A which is a subclass of a class B. If we look at the internal layout of a class A instance than most C++ implementations will place the members inherited from class B at the beginning and the members added in the class A declaration behind them, I think. If a pointer to A is casted to a pointer to B then no action is needed because the beginning of the A instance is a valid B instance. But if A is a...
22
10355
by: DJ WIce | last post by:
Hi, I'm looking for a script to get the hi-est z-index on a page. I want my javascript menu to be always on top of the page (moves along on top when you scroll down). Does anyone know how to scann all items/elements on the page for a z-index? Thanks, Wouter
4
1520
by: Boni | last post by:
Dear all, is it possible to determine if a particular control (i.e. Listbox) has focus, without implementing gotfocus/lostfocus? I can't find such property. P.S I know that I can implement such property, with gotfocus/lostfocus, but may be there is a better way?
8
21326
by: Boni | last post by:
Dear all, is it possible to get a name of control on the form, which is currently in focus. Thanks, Boni
2
1737
by: Anders | last post by:
Hi Im trying to develop a C# application which interacts with a Fingerprint scanner. The appliaction is going to run in the background (and as trayicon). When my applicatons catches an event from the finger scanner i want to paste a text into "what ever active textbox control is focused" and the execute a "press enter command". Eg. a focused textbox control in Internet Explorer.
1
2478
by: jurgro | last post by:
Hello. I am developing an Activex control to show animated gif and other images. With windowlessActivate flag the control is transparent. I want to show animated gif in a thread. Now the problem: The thread needs a pointer to the control. "A CWnd*". It works fine without windowlessActivate flag but with the flag I have no CWnd pointer to the control. Is there a way to get a pointer to the control even though it is windowless? The control...
0
873
by: Gilgul | last post by:
Hi i am trying to find the handle of the current focused control in all the running application. I tried GETFOCUS() but it gave the the handle only of the current thread There are 2 options of solving it. One, is to find an API function that do it. Secound, is to find a function that detarmin if a control is focused the i can make a loop checking all the controls. Please halp me fint one of this functions. BTW: I allready tried
50
4487
by: Juha Nieminen | last post by:
I asked a long time ago in this group how to make a smart pointer which works with incomplete types. I got this answer (only relevant parts included): //------------------------------------------------------------------ template<typename Data_t> class SmartPointer { Data_t* data; void(*deleterFunc)(Data_t*);
21
4812
by: AdamOnAccess | last post by:
I am trying to set the focus on a button that sits on page 1 of my tab control. It looks like I'm successful at setting the focus because I see the highlight on the button, but when I push the space-bar, I get the sub menu for the main form; the button does not press down. I notice that when I click on the tab control, the highlighted button takes on an "added highlight". It looks like a dotted line over the original highlight. If I press the...
0
8888
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8097
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.