Código vb:
Ver original
Public Function EstablecerPermisos(ByVal nomventana As Control, ByVal ventana As String, ByVal permisos As ListView) As Boolean Dim posx As Integer = 0 Dim encontrado As Boolean = False With permisos While posx < .Items.Count And Not encontrado If .Items(posx).SubItems(1).Text = ventana And .Items(posx).Checked = True Then encontrado = True Else posx = posx + 1 End If If encontrado Then While (posx) < .Items.Count If .Items(posx).SubItems(1).Text = ventana Then If .Items(posx).Checked = True Then comp = .Items(posx).SubItems(4).Text nomventana.Controls(comp).Enabled = False ' frmPrincipal.button1.Enabled = False //ESTO SERIA LO MISMO QUE LA LINEA ANTERIOR ' frmPrincipal.mnuArchivoNuevo.Enabled = False //ESTO SERIA LO MISMO QUE LA LINEA ANTERIOR PERO AQUI ME DA ERROR End If posx = posx + 1 End If End While End If End While End With Return True End Function