layer Posted October 4, 2006 Posted October 4, 2006 hi,my problem/question is, can i have a child GUI that cannot be dragged out of its parent? or is there a setting for this?so far i have this code (images attached if you'd like:$MAINGUI = GUICreate("Coins", 600, 400) $FILEMENU = GUICtrlCreateMenu("File") $FILEMENUSECT1 = GUICtrlCreateMenuItem("Open player...", $FILEMENU) $FILEMENUSECT2 = GUICtrlCreateMenuItem("Save player...", $FILEMENU) $FILEMENUSECT3 = GUICtrlCreateMenuItem("Save", $FILEMENU) GUICtrlCreateMenuItem("", $FILEMENU) $FILEMENUSECT4 = GUICtrlCreateMenuItem("Exit", $FILEMENU) GUICtrlCreatePic("backround.jpg", 0, 0, 600, 380) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW, $MAINGUI) ; ; $DIMEWIN = GUICreate("", 40, 40, 20, 20, $WS_POPUP, BitOr($WS_EX_LAYERED, $WS_EX_MDICHILD), $MAINGUI) $DIME = GUICtrlCreatePic("dime.gif", 0, 0, 40, 40) GUISetState(@SW_SHOW, $DIMEWIN) ;GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ; ; ; While 1 $GET = GUIGetMsg() If $GET = $GUI_EVENT_CLOSE Then Exit If $GET = $FILEMENUSECT4 Then Exit If $GET = $DIME Then Drag($DIMEWIN) WEnd ; ; ; Func Drag($WIN) Do $MOUSEPOS = MouseGetPos() WinMove($WIN, "", $MOUSEPOS[0], $MOUSEPOS[1]) Until _IsPressed(01) = 0 EndFuncand when you Drag the dime, the child window can be dragged anywhere evn outside of the parent, i don't want this, i need a way to only allow it to be dragged inside the parent GUIany ideas ?thanks FootbaG
Uten Posted October 4, 2006 Posted October 4, 2006 WindowInWindow by Holger (I think) Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
layer Posted October 4, 2006 Author Posted October 4, 2006 (edited) thanks Uten, exactly what i was looking foredit i dont really have time to look in depth at the code now but it doesnt seem that you can use this script for two GUI's running in one script, does anyone know ? again i'll look more at it when i get back Edited October 4, 2006 by layer FootbaG
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now