Jump to content

How to create a subpanel as a child window?


qwert
 Share

Recommended Posts

After reading about $WS_EX_MDICHILD, I thought this would be simple. "Create a child window included in its parent window." it says ... but nothing I've tried will work. The PNG shows what I was expecting. This is my script, so far:

#include <GUIConstantsEx.au3>
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>
#Include <GuiScrollBars.au3>
#include <ScrollBarConstants.au3>
Opt("GUIOnEventMode", 1)
$Form = GUICreate("Test", 600, 300, -1, -1,-1 ,BitOR($WS_EX_WINDOWEDGE, $WS_EX_TOPMOST))
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")
GUICtrlCreateLabel("Text Field", 20, 20)
$rich1 = _GUICtrlRichEdit_Create($Form, "", 20, 40, 200, 200, BitOR($ES_WANTRETURN, $ES_MULTILINE, $WS_VSCROLL))
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
_GUIScrollBars_ShowScrollBar($rich1, $SB_VERT, True)
GUISetState(@SW_SHOW)
$SubForm = GUICreate("Side Panel", 300, 240, 240, 40, $WS_CHILD ,BitOR($WS_EX_WINDOWEDGE, $WS_EX_TOPMOST, $WS_EX_MDICHILD), $Form)
GUICtrlCreateLabel("Second Text Field", 300, 20)
$rich2 = _GUICtrlRichEdit_Create($SubForm, "", 20, 40, 200, 200, BitOR($ES_WANTRETURN, $ES_MULTILINE, $WS_VSCROLL))
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
_GUIScrollBars_ShowScrollBar($rich2, $SB_VERT, True)
GUISetState(@SW_SHOW)
While 1
Sleep(50)
WEnd
Func Terminate()
    _GUICtrlRichEdit_Destroy($rich1)
    _GUICtrlRichEdit_Destroy($rich2)
    Exit
EndFunc

If I'm completely misunderstanding, please let me know. My end objective is to have a 3-tap panel as a sub-window, which eventually might be able to be "detachable" (free-floating).

Thanks for any assistance.

post-29172-0-50834800-1317588833_thumb.p

Link to comment
Share on other sites

WS_CHILD and WS_EX_MDICHILD don't go together so

$SubForm = GUICreate("Side Panel", 300, 240, 240, 40, $WS_CHILD ,BitOR($WS_EX_WINDOWEDGE,$WS_EX_TOPMOST), $Form)

or

$SubForm = GUICreate("Side Panel", 300, 240, 240, 40, $WS_CHILD ,-1, $Form)

should work.

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.
Link to comment
Share on other sites

$SubForm = GUICreate("Side Panel", 300, 240, 240, 40, -1 ,BitOR($WS_EX_WINDOWEDGE, $WS_EX_TOPMOST, $WS_EX_MDICHILD), $Form)

I don't know why.

martin, just as a clarification: I tried both of your suggestions, but neither produced the overlaid window effect that JohnOne's suggestion (using -1) did. I don't have time to delve into why, but thanks for the response.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...