Thursday, 13 June 2013

disable(readonly) all control of a form(window) from other window in

Hi  i  made all control except close button disable all read only in this way. my all control in the panel and i disable all that and also made disable all toolbar control

Private Sub FrmTodoList_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

  If IsReadOnly Then
        End If
    End Sub

 Private Sub DisableAll()
        Me.PnlCSDetail.Enabled = False
        For Each tool As Infragistics.Win.UltraWinToolbars.ToolBase In Me.TBMCSDetail.Toolbars(0).Tools
            If Not tool.Key.ToLower.Equals("dclose") Then
                tool.SharedProps.Visible = False
                tool.SharedProps.Enabled = False
            End If

 Public Property IsReadOnly() As Boolean
            Return _isReadOnly
        End Get
        Set(ByVal value As Boolean)
            _isReadOnly = value
        End Set
    End Property
Ahmad Khalid
Software Engineer