Pointer on focused control

B

Boni

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
 
H

Herfried K. Wagner [MVP]

Boni said:
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.
 
B

Boni

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top