none
c# Textbox双击实现0与1的变换 RRS feed

答案

  • 楼主 你好,

    请参考下面的代码:

    <TextBox MouseDoubleClick="TextBox_MouseDoubleClick" Text="0" x:Name="myTxtBox"/>
            private void TextBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
            {
                if (myTxtBox.Text == "0")
                {
                    myTxtBox.Text = "1";
                }
                else if(myTxtBox.Text == "1")
                {
                    myTxtBox.Text = "0";
                }
            }
    谢谢!

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • 已标记为答案 Rogerguo 2014年10月24日 6:42
    2014年10月24日 1:43
    版主