تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
كيفي عمل التفعيل و التعطيل للقوائم في ToolStrip
#10
السلام عليكم ورحمة الله وبركاته

كود :
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        
        DisableAllButtons(ToolStrip1, True)


    End Sub


    Public Sub DisableAllButtons(ByVal ts As ToolStrip, ByVal b As Boolean)
        Dim i As Integer = 0
        For i = 0 To ts.Items.Count - 1
            Child(ts.Items(i), b)
        Next
    End Sub


    Private Sub Child(ByVal DDI As ToolStripDropDownItem, ByVal b As Boolean)
        For Each itm As ToolStripDropDownItem In DDI.DropDownItems
            itm.Enabled = b
            If itm.HasDropDownItems Then
                For Each it As ToolStripDropDownItem In itm.DropDownItems
                    Child(it, b)
                Next
                For Each it As ToolStripMenuItem In itm.DropDownItems
                    it.Enabled = b
                Next
            End If
        Next
    End Sub


****
***
**
*
(وَقُل رَّبِّ زِدْنِي عِلْمًا)

الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
كيفي عمل التفعيل و التعطيل للقوائم في ToolStrip - بواسطة kslawy - 23-10-12, 04:30 PM


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم