Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/02/2008, 03:05
Avatar de Drako_18
Drako_18
 
Fecha de Ingreso: mayo-2005
Ubicación: Madrid
Mensajes: 505
Antigüedad: 19 años, 9 meses
Puntos: 16
Re: mdiparent + mdichildren

Buenas compañero;

yo tengo hecho algo parecido en una funcion (VB.NET) te la paso haber si te sirve...

La Funcion es:
Código:
Private Function ExisteChildrens(ByVal ofrm As Form) As Boolean
  Dim bValido As Boolean
 
  For i As Integer = 0 To Me.MdiChildren.Length - 1
   If Me.MdiChildren(i).Name = ofrm.Name Then
    Me.MdiChildren(i).Focus()
  bValido = True
   End If
  Next

  For i As Integer = 0 To Me.OwnedForms.Length - 1
   If Me.OwnedForms(i).Name = ofrm.Name Then
    Me.OwnedForms(i).Focus()
  bValido = True
   End If
  Next
 
  Return bValido
End Function 


Y Se utliza...

Código:
 
PrivateSub mnuAltaProv_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAltaProv.Click
  Dim oFormulafio As New frmAltaProveedor

  If ExisteChildrens(oFormulafio) = False Then
oFormulafio.MdiParent = Me
oFormulafio.Tag = Me.dsEspada.proveedores
oFormulafio.Show()
  End If
End Sub 



De nada compañero (de antemano :P) jejeje que te vaya lindo
(desde sevilla, España)
__________________
Rubén Espada
Desarrollador full stack .Net (Angular + JS + .Net Core)