|
|
C#
private void btnClear_Click(object sender, RoutedEventArgs e)
{foreach (object child in container.Children)
{ if (child is TextBlock || child is TextBox)
(child as TextBlock).Text = String.Empty;
}
}
VB.NET
Private Sub btnClear_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
For Each child As Object In container.Children
If TypeOf child Is TextBlock OrElse TypeOf child Is TextBox Then
TryCast(child, TextBlock).Text = String.Empty
End If
Next childEnd Sub
'Like' us on our FaceBook page if you find this blog useful. Thanks!
Did you like this post?
|
|
|
||
|
|
|
|
Save on Delicious |
|
|
subscribe via rss |
|
subscribe via e-mail |
|
|
print this post |
|
follow me on twitter |




comments
0 Responses to "Clear TextBoxes from a Container control in Silverlight"Post a Comment