Hi Herfried,
thanks. But it seems that the .ActiveForm can only get the form from the
application itself. When I set my Notepad as the active form, then an
exception happens. Anyhow that I can get the control in other application?
Since other application may not be developed in .net, would it be a problem?
Secondly, I want to put some text on the control having the focus, which I
can use .Text property if it were a textbox. But when it is not, eg Button,
then I would modified the button's caption (.Text). Anyhow I can do something
like SendKey on the control so it would simply change the text wrongly.
Remember that I have got problem with SendKey initially that causes me to
find alternative. I still can't figure out why SendKey is not working. Anyone
know in what condition SendKey would not work?
Eugene
"Herfried K. Wagner [MVP]" wrote:
"Eugene" <Eu****@discussions.microsoft.com> schrieb: With your example, consider I have multiple forms
shown in one application, how can I determine which form is currently
active?
You can use 'Form.ActiveForm' to get a reference to the active form.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>