04-02-15, 11:23 AM
بما ان كود كيف تعبي الشجرة انظر
هذه الدالة لجلب كل الادوات الفي الفورم لكن في ادوات داخل الفوم لها ادوات اخرى مثل groupbox
لذلك محتاجين دالة ثانية تابع معي
هذه كل القصة لجلب القائمة او غيره ممكن تستخدم الداله الثانية
والامور طيبة ^_^
كود :
Public Function FindAllChildren(ByRef StartingContainer As System.Windows.Forms.Form)
As List(Of System.Windows.Forms.Control)
Dim Children As New List(Of System.Windows.Forms.Control)
Dim oControl As System.Windows.Forms.Control
For Each oControl In StartingContainer.Controls
Children.Add(oControl)
If oControl.HasChildren Then
Children.AddRange(oControl.FindAllChildren())
End If
Next
Return Children
End Function
لذلك محتاجين دالة ثانية تابع معي
كود :
Public Function FindAllChildren(ByRef StartingContainer As System.Windows.Forms.Control)
As List(Of System.Windows.Forms.Control)
Dim Children As New List(Of System.Windows.Forms.Control)
If StartingContainer.HasChildren = False Then
Return Nothing
Else
Dim oControl As System.Windows.Forms.Control
For Each oControl In StartingContainer.Controls
Children.Add(oControl)
If oControl.HasChildren Then
Children.AddRange(oControl.FindAllChildren())
End If
Next
End If
Return Children
End Function
هذه كل القصة لجلب القائمة او غيره ممكن تستخدم الداله الثانية
والامور طيبة ^_^