开发者

How to make a button button type (custom keyboard)

开发者 https://www.devze.com 2023-02-03 00:36 出处:网络
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 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


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?


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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号