Sign in to follow this  
Followers 0
FlyInSky

HOW can i create a MDI?

9 posts in this topic

I want to create a Form,but It is need include a Child Form.I don't know how to do it. Its like MDI in VB .

Who can Help me?

Share this post


Link to post
Share on other sites



I means the child form is inside of parent form.What can i do?thanks

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I means the child form is inside of parent form.What can i do?thanks

Is this the sort of thing you want?

#include <GUIConstants.au3>

$gui=GUICreate("Parent", 800, 300,400,400,-1)

$add2 = GUICtrlCreateButton('Add form',10,30)

GUISetState(@SW_SHOW)
$c1=GUICreate("child 1", 140, 180, 100, 100,$WS_OVERLAPPED)
DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($c1), "hwnd", WinGetHandle($GUI))   

GUISetState()
$c2 = 0;no 2nd child window yet

do
    $msg = GUIGetMsg()
    
    if $msg = $add2 then 
        if not $c2 then
         $c2=GUICreate("child 2", 140, 180, 120, 120,$WS_OVERLAPPED)
         DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($c2), "hwnd",                               WinGetHandle($GUI)) 
             GUISetState(@SW_SHOW)  
         GUICtrlSetState($add2,$GUI_HIDE)
        EndIf
    EndIf

    if $msg = $GUI_EVENT_CLOSE Then ExitLoop
    
until 0
Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Is this the sort of thing you want?

#include <GUIConstants.au3>

$gui=GUICreate("Parent", 800, 300,400,400,-1)

$add2 = GUICtrlCreateButton('Add form',10,30)

GUISetState(@SW_SHOW)
$c1=GUICreate("child 1", 140, 180, 100, 100,$WS_OVERLAPPED)
DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($c1), "hwnd", WinGetHandle($GUI))   

GUISetState()
$c2 = 0;no 2nd child window yet

do
    $msg = GUIGetMsg()
    
    if $msg = $add2 then 
        if not $c2 then
         $c2=GUICreate("child 2", 140, 180, 120, 120,$WS_OVERLAPPED)
         DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($c2), "hwnd",                               WinGetHandle($GUI)) 
             GUISetState(@SW_SHOW)  
         GUICtrlSetState($add2,$GUI_HIDE)
        EndIf
    EndIf

    if $msg = $GUI_EVENT_CLOSE Then ExitLoop
    
until 0
you couldn't reply to my help topic http://www.autoitscript.com/forum/index.php?showtopic=33937 :ph34r:

it's what i needed, thank you :lmao:


FootbaG

Share this post


Link to post
Share on other sites

you couldn't reply to my help topic http://www.autoitscript.com/forum/index.php?showtopic=33937 :ph34r:

it's what i needed, thank you :lmao:

Uten gave you the answer in that thread!


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

well, sort of, i thought it was then i edited my post, i guess i could have made the edit more clear

your way lets me do what Holger's code does except with your code i can use multiple GUI's created from AutoIt and get the same affect rather then a process with a window from Run() :lmao:

Edited by layer

FootbaG

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

First,I thank you.But I have some question about the code.Why not to use $WS_CHILD of GUI Control Styles Appendix ?How to hide the menu bar of the child in your code? Where have a handbook of "user32.dll"? Thank you!

Edited by FlyInSky

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0