0

hi,

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.

3
Contributors
13
Replies
15
Views
7 Years
Discussion Span
Last Post by ddanbe
0

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.

0

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

SendKeys.Send("s");

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

im clear now i think.

pls do help.

0

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

0

no sir,

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

help.

0

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

how to strike that.

0

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

if so pls guide me ill try it.

0

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

0

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()
        {
            InitializeComponent();
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            MessageBox.Show("hi");
            SendKeys.Send("{Enter}");
        }
    }
}

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

Edited by khan17: n/a

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.