06-12-19, 06:00 PM
(آخر تعديل لهذه المشاركة : 06-12-19, 06:01 PM {2} بواسطة محمد كريّم.)
(06-12-19, 05:28 PM)alshandodi كتب : شكرا جزيلا لك اخي العزيز محمد كريّم
ما هو Function للبحث داخل كامل الفورم لان يوجد لدي اكثر من panel
آسف هو Sub لا يرجع قيمة وليس Function
كود :
Private Sub StyleControls(ParentCtrl As Control)
For Each ctrl As Control In ParentCtrl.Controls
If TypeOf ctrl Is TextBox Then
ctrl.BackColor = Color.Black
ctrl.ForeColor = Color.White
ElseIf TypeOf ctrl Is Button Then
ctrl.BackColor = Color.Black
ctrl.ForeColor = Color.White
ElseIf TypeOf ctrl Is ComboBox Then
ctrl.BackColor = Color.Black
ctrl.ForeColor = Color.White
ElseIf TypeOf ctrl Is Panel Then
StyleControls(ctrl)
ElseIf TypeOf ctrl Is GroupBox Then
StyleControls(ctrl)
End If
Next
End Subطريقة الاستخدام :
كود :
StyleControls(Me) 'لكل أدوات الفورم
StyleControls(Panel1) 'لأدوات بانل معين فقط
StyleControls(GroupBox1) 'لأدوات قروب بوكس معين فقط
