Formularios dentro de un formulario 
Author Message
 Formularios dentro de un formulario

Tengo un programa que contiene muchos formularios dispersos y quisiera
mostrar varios formularios en una misma ventana al estilo de outlook
express, alguien sabe como??


Fri, 11 Apr 2003 03:00:00 GMT  
 Formularios dentro de un formulario

Quote:
> Tengo un programa que contiene muchos formularios dispersos y quisiera
> mostrar varios formularios en una misma ventana al estilo de outlook
> express, alguien sabe como??

Add three picture box's to a form, then paste this code in and run:

'*** START CUT ***'

Const BorderSize = 30 'The border width (Twips)

Private Sub Form_Resize()
    Dim ScaleSize(1) As Integer

    'Get the size of the panes
    ScaleSize(0) = (Form1.ScaleWidth \ 2) - BorderSize
    ScaleSize(1) = (Form1.ScaleHeight \ 2) - BorderSize

    'To prevent scaling controls to less than 0
    If ScaleSize(0) < 0 Or ScaleSize(1) < 0 Then Exit Sub

    'Scale the picture box's
    Picture1.Move 0, 0, ScaleSize(0), ScaleSize(1)
    Picture2.Move ScaleSize(0) + (BorderSize * 2), _
        0, ScaleSize(0), ScaleSize(1)
    Picture3.Move 0, ScaleSize(1) + (BorderSize * 2), _
        Form1.ScaleWidth, ScaleSize(1)
End Sub

'*** END CUT **'

Hope this helps,

    Mike

 -- EDais --

WWW: Http://Members.xoom.com/EDais/




Sat, 12 Apr 2003 11:34:32 GMT  
 Formularios dentro de un formulario
Thanks for your help, this is similar that what i am looking for. But I want
to put in the form anothers forms. Thanks again.



Quote:
> > Tengo un programa que contiene muchos formularios dispersos y quisiera
> > mostrar varios formularios en una misma ventana al estilo de outlook
> > express, alguien sabe como??

> Add three picture box's to a form, then paste this code in and run:

> '*** START CUT ***'

> Const BorderSize = 30 'The border width (Twips)

> Private Sub Form_Resize()
>     Dim ScaleSize(1) As Integer

>     'Get the size of the panes
>     ScaleSize(0) = (Form1.ScaleWidth \ 2) - BorderSize
>     ScaleSize(1) = (Form1.ScaleHeight \ 2) - BorderSize

>     'To prevent scaling controls to less than 0
>     If ScaleSize(0) < 0 Or ScaleSize(1) < 0 Then Exit Sub

>     'Scale the picture box's
>     Picture1.Move 0, 0, ScaleSize(0), ScaleSize(1)
>     Picture2.Move ScaleSize(0) + (BorderSize * 2), _
>         0, ScaleSize(0), ScaleSize(1)
>     Picture3.Move 0, ScaleSize(1) + (BorderSize * 2), _
>         Form1.ScaleWidth, ScaleSize(1)
> End Sub

> '*** END CUT **'

> Hope this helps,

>     Mike

>  -- EDais --

> WWW: Http://Members.xoom.com/EDais/





Sat, 12 Apr 2003 03:00:00 GMT  
 Formularios dentro de un formulario



Quote:
> Thanks for your help, this is similar that what i am looking for. But I
want
> to put in the form anothers forms. Thanks again.

Could you maybe ask again in English? Thanks.

Phillip



Mon, 14 Apr 2003 21:18:32 GMT  
 Formularios dentro de un formulario
If you don't want pictureboxes you could use the SetParent API.


Tue, 15 Apr 2003 00:07:28 GMT  
 Formularios dentro de un formulario

Thanks a lot for your help, i find the code that puts a form into a form,
it's here.

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As Long, ByVal lpWindowName As Long) As Long
Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long,
ByVal hWndNewParent As Long) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd
As Long, lpdwProcessId As Long) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal
wCmd As Long) As Long
Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As
Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As
Long
Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As
Long, ByVal uExitCode As Long) As Long
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare Function Putfocus Lib "user32" Alias "SetFocus" (ByVal hwnd
As Long) As Long
Const GW_HWNDNEXT = 2
Dim mWnd As Long
Function InstanceToWnd(ByVal target_pid As Long) As Long
    Dim test_hwnd As Long, test_pid As Long, test_thread_id As Long
    'Find the first window
    test_hwnd = FindWindow(ByVal 0&, ByVal 0&)
    Do While test_hwnd <> 0
        'Check if the window isn't a child
        If GetParent(test_hwnd) = 0 Then
            'Get the window's thread
            test_thread_id = GetWindowThreadProcessId(test_hwnd, test_pid)
            If test_pid = target_pid Then
                InstanceToWnd = test_hwnd
                Exit Do
            End If
        End If
        'retrieve the next window
        test_hwnd = GetWindow(test_hwnd, GW_HWNDNEXT)
    Loop
End Function
Private Sub Form_Load()
    'KPD-Team 1999
    'URL: http://kpdweb.cjb.net/

    Dim Pid As Long
    'Lock the window update
    LockWindowUpdate GetDesktopWindow
    'Execute notepad.Exe
    Pid = Shell("c:\windows\notepad.exe", vbNormalFocus)
    If Pid = 0 Then MsgBox "Error starting the app"
    'retrieve the handle of the window
    mWnd = InstanceToWnd(Pid)
    'Set the notepad's parent
    SetParent mWnd, Me.hwnd
    'Put the focus on notepad
    Putfocus mWnd
    'Unlock windowupdate
    LockWindowUpdate False
End Sub
Private Sub Form_Unload(Cancel As Integer)
    'Unload notepad
    DestroyWindow mWnd
    'End this program
    TerminateProcess GetCurrentProcess, 0
End Sub



Fri, 02 May 2003 03:00:00 GMT  
 Formularios dentro de un formulario

thanks, with SetParent i found the way.


Quote:
> If you don't want pictureboxes you could use the SetParent API.



Sat, 03 May 2003 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Formularios dentro de un formulario

2. Formularios dentro de un formulario

3. Formularios dentro de un formulario

4. Formularios dentro de un formulario

5. Modificar propiedades de un objeto conociendo el handle de su formulario

6. Controles en un formulario

7. Creating Form Designer/Creando Dise?ador de Formularios

8. Creating Form Designer/Creando Dise?ador de Formularios

9. Creating Form Designer/Creando Dise?ador de Formularios

10. impresión de un grafico o de un mschart con el obj printer

11. impresión de un grafico o de un mschart con el obj printer

12. Formularios Invisibles

 

 
Powered by phpBB® Forum Software