i know tat enter and f1 keys can be pressed programmatically using "SendKeys" function. but now i just want to know whether it is possible to press the alphabet 'S' in the keyboard programmatically.

Expecting reply.


thanks for replying..

but that doesnt work.

any other ideas?

I think you will need to supply some more information about what you are doing and perhaps a code snippet of what is going wrong would help.

im doing a project to automate a process. is about downloading, when i automate the button click programmatically (Download button) it opens a dialog box asking whether to open,save or cancel. i need to give input from the keyboard or mouse click. since to automate that im trying using


to automatically cstrikes tha save button in that dialog box..

im clear now i think.

pls do help.

Are you sure 's' is the correct key, normally 'Enter' is the default accept for a dialogue or 'Ctrl'+'S' in general.

no sir,

the default accept for that dialog box is 'CANCEL'. so only i ve tried like this. but no hopes.


Try holding down alt and see what keys show up underlined eg Alt+S

its showing S for Save and O for open and CANCEL is the default one.

how to strike that.

I think according to MS you do this SendKeys("%s") .

sorry sir it also doesnt work.. is there any other way to automate saving the file.

if so pls guide me ill try it.

As I don't know what program you are trying to affect I don't really know any more than I have already said.

i dont know why its not functioning for me... even i ve tried in a sample application like this.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace sendke
    public partial class Form1 : Form
        public Form1()

        private void radioButton1_CheckedChanged(object sender, EventArgs e)

but this too is not working.. need help. pls..

Ever tried to implement the KeyDown event of the Dialog?
It gives you a KeyEventArgs argument with which you can test the key that was pressed. You can then act accordingly.