在文本框中输值与清除值

 private void myTextBox_TextChanged(object sender, TextChangedEventArgs e)      

   {       

      myTextBlock.Text = "you typed: " + myTextBox.Text;       

  }

        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)   

      {            myTextBox.Focus();

        }

        private void myButton_Click_1(object sender, RoutedEventArgs e)        

 {    myTextBox.Text = "";             

      myTextBlock.Text = "";            

       myTextBox.Focus();//再次调用focus,使输入键盘在clear之后仍出现                                 

 }    

编辑器加载中...

posted @ 2012-03-05 21:30  zhangmengjie  Views(101)  Comments(0)    收藏  举报