Hi,
Creating child windows in Creative Basic is easy.
Create a main window (there's no need to use the @MDIFRAME parameter) as the parent window.
For all other child windows, use the parent windows variable as the 'parent' parameter of the window.
' Program demonstrating a simple (non-MDI) main/child window arrangement.
' GWS - 2012
def main,child:WINDOW
window main,0,0,500,300,@MINBOX|@MAXBOX|@SIZE,0,"MainWindow",mainhandler
window child,0,0,200,100,@SIZE,main,"Child Window",childhandler
setwindowcolor main,0xff8800
setwindowcolor child,0xaa6666
centerwindow main
centerwindow child
run = 1
waituntil run = 0
closewindow main :' Note: this also closes any remaining child windows
end
mainhandler:
SELECT @CLASS
case @IDCLOSEWINDOW
run = 0
ENDSELECT
RETURN
childhandler:
SELECT @CLASS
case @IDCLOSEWINDOW
closewindow child
ENDSELECT
RETURN
Now the child window remains on top of the parent. This is good for things like tool windows, information boxes, etc.
If the main window is closed, all child windows are also closed.
all the best, :)
Graham
Nicely done, Graham ... thanks!
You're welcome .. :)
Graham