Cómo hacer un tipo de botón de botón (teclado personalizado)

I am creating a Spanish application in C# which will help first year students at my high school. I want to create a "custom keyboard" for characters that cannot be easily typed (Á É Í Ó Ú Ñ Ü ¡ ¿ á é í ó ú ñ ü). I was just thinking of making buttons across the bottom of the screen which would add that character to the text field when pressed. I have not be able to find anything of use. Thanks in advance

preguntado el 08 de enero de 11 a las 21:01

Are you wanting the actual code, or just some guidance on what path to go down? -

Ahhh high school "CS" courses. -

This is already built-in for Windows. Control Panel + Region and Language to install additional keyboard layouts. The language bar to switch between them. osk.exe to get a clickable keyboard on the screen. -

2 Respuestas

Thank you everyone. I figured out something that worked for what I am doing (even though it may be inefficient)

    private void btnUpsidedownEx_Click(object sender, EventArgs e)
    {
        txtAnswer.Text = txtAnswer.Text + "¡";
        txtAnswer.Focus();
    }

The only problem is that when the focus returns to the text box it highlights the text so if someone continues to type, it will erase everything before. Any suggestions on how to put the cursor at the end of the text?

Respondido el 17 de enero de 11 a las 06:01

You have to point to end of the text on the textBox. something like this: (ControlToBind is a textBox)

if (ControlToBind != null)
                    ControlToBind.Select(tempStart, 0);

private void btnUpsidedownEx_Click(object sender, EventArgs e)
    {
        txtAnswer.Text = txtAnswer.Text + "¡";
tempstart=
        txtAnswer.Focus();
    }

Respondido 21 ago 11, 21:08

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.