![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
The button event handler for XAML page not firing for Textbox field, but it fires for the date selected value for calendar. |
#3
| |||
| |||
|
|
Hi Alex, The button event handler for XAML page not firing for Textbox field, but it fires for the date selected value for calendar. Is my understanding correct that you want to output below after clicking the ok button? Hi [user input in the TextBox goes here] Selected Date: [user selected date goes here] The problem is whatever you input in the TextBox, it always shows: Hi Name: Selected Date: [user selected date goes here] Right? If so the problem is you're referring to the TextBlock instead of the TextBox in the code behind. Please try this: xaml: TextBox x:Name="TextBox1" Text="Your Name" Width="150" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="1"></TextBox xaml.cs private void okButton_Click(object sender, RoutedEventArgs e) { string dateString; if (cal1.SelectedDate == null) { dateString = "<date not selected>"; } else { dateString = cal1.SelectedDate.ToString(); } string s = message1.Text = "Hi " + TextBox1.Text + "\n" + "Selected Date: " + dateString; } In xaml give the TextBox a name and refer to it in code behind by its name. If my understanding is wrong please clarify the problem. Regards, Allen Chen Microsoft Online Support Delighting our customers is our #1 priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please feel free to let my manager know what you think of the level of service provided. You can send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com. ================================================== Get notification to my posts through email? Please refer to http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications. Note: MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 2 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. |
#4
| |||
| |||
|
|
Thanks for the code suggestion. I have implemented them in my project but still not getting the right output. I am sending a zipped file to your in box for you to take a look at. |
#5
| |||
| |||
|
|
Hi Alex, Thanks for the code suggestion. I have implemented them in my project but still not getting the right output. I am sending a zipped file to your in box for you to take a look at. Thanks for your project. You're adding a new TextBox whose name is TextBox1. However the original TextBox still exists there and it's the TextBox whose Text is changed by you. The new TextBox1 is not shown on the screen therefore you cannot change it's Text. Please remove the following TextBox from the xaml to make it work: TextBox Text="Your Name" Width="150" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="1"></TextBox Regards, Allen Chen Microsoft Online Support |
#6
| |||
| |||
|
|
I am starting to get up to speed on Databinding and have realized I need to get comfortable with WCF. Could you point me to some good links on these topics |
#7
| |||
| |||
|
|
I am starting to get up to speed on Databinding and have realized I need to get comfortable with WCF. Could you point me to some good links on these topics |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |