Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Sub Command1_Click() Dim oForm As Form2 Set oForm = New Form2 Call SetParent(oForm.hWnd, Me.hWnd) Call oForm.Show Set oForm = Nothing End Sub
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/
"Yang Li Ke" a écrit dans le message de news: IAiXb.12391$
Bonjour à tous,
Est-il possible d'ouvrir plusieurs instances d'une form à l'intérieur
d'une
même forme principale en utilisant ce genre de code:
Dim oForm As Form1 Set oForm = New Form1 Call oForm.Show Set oForm = Nothing -- Merci !!!
Yang
Salut,
Je vois deux solutions :
1/ Utiliser une feuille MDI et définir Form1 en tant que MDIChild (MDIChild
= True)
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long,
ByVal hWndNewParent As Long) As Long
Private Sub Command1_Click()
Dim oForm As Form2
Set oForm = New Form2
Call SetParent(oForm.hWnd, Me.hWnd)
Call oForm.Show
Set oForm = Nothing
End Sub
--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
"Yang Li Ke" <yanglike@sympatico.ca> a écrit dans le message de news:
IAiXb.12391$lK.804087@news20.bellglobal.com...
Bonjour à tous,
Est-il possible d'ouvrir plusieurs instances d'une form à l'intérieur
d'une
même forme principale en utilisant ce genre de code:
Dim oForm As Form1
Set oForm = New Form1
Call oForm.Show
Set oForm = Nothing
--
Merci !!!
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Sub Command1_Click() Dim oForm As Form2 Set oForm = New Form2 Call SetParent(oForm.hWnd, Me.hWnd) Call oForm.Show Set oForm = Nothing End Sub
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/
"Yang Li Ke" a écrit dans le message de news: IAiXb.12391$
Bonjour à tous,
Est-il possible d'ouvrir plusieurs instances d'une form à l'intérieur
d'une
même forme principale en utilisant ce genre de code:
Dim oForm As Form1 Set oForm = New Form1 Call oForm.Show Set oForm = Nothing -- Merci !!!