🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.csharpbuilder.language.csharp
1 messages
1 total messages Started by Shane Thu, 31 Aug 2006 04:48
send keys
#161
Author: Shane
Date: Thu, 31 Aug 2006 04:48
35 lines
2286 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads