Dim c As MyCanvas Protected Overrides Sub OnPreviewMouseDown(ByVal e As MouseButtonEventArgs) MyBase.OnPreviewMouseDown(e) Dim m As Integer m = VisualTreeHelper.GetChildrenCount(c) - 1 MessageBox.Show(m) 'to display the number of 'child elements on the canvas End Sub
c
MyCanvas.Children.Count
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)