Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

send keys

1 view
Skip to first unread message

Shane

unread,
Aug 31, 2006, 12:48:07 AM8/31/06
to
Hi all :-)
I have created a simple form with buttons, the form does as I wish, clicking
on the buttons with the mouse produces the desired result. I have decided
that to make it really clever I should tie key presses to the form
(somehow) so that if I press a '2' key ,then I'd like a button to act as
though it has been clicked, and the normal course of events should flow
from there.

Ive had a look on google, I got the following link, which *sounds* to me
what I want, but I dont know how to implement it into my form.
http://msdn2.microsoft.com/en-us/library/system.windows.forms.sendkeys.send.aspx
What I tried was copying and pasting what I thought was the constructor into
my code

public static void Send (
string keys
)

and then pasted the following line into my private button2_click() event
SendKeys.Send("2");

But I got an error about Send not being a function (etc)
So Im guessing Ive not done something right

Any help appreciated

TIA


--
"I'm never gonna get used to the thirty-first century. Caffeinated bacon?
Baconated grapefruit? Admiral Crunch?" -Fry
"Well if you don't like that, try some Archduke Chocula." -Leela

blog: http://shanes.dyndns.org

0 new messages