Jump to content

Recommended Posts

Hello,

is it possible to make a child guy acting like a GuiControl when scrolling the parent window? the way i am trying it makes the child gui dissapear when moving or minimizing the parent window.

Thanks in advance. 👍

 

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiScrollBars.au3>

HotKeySet("{RIGHT}", "ScrollRight")
HotKeySet("{LEFT}", "ScrollLeft")

$hParent = GUICreate("Parent", 1300, 800, -1, -1)
GUICtrlCreateButton("Button", 150, 150, 150, 50)
GUISetState()


$hChild = GUICreate("Child", 100, 100, -1,-1, $WS_CHILD , $WS_EX_MDICHILD, $hParent)
GUISetBkColor(0x000000)
GUISetState()



_GUIScrollBars_Init($hParent, 10000)




While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop

    EndSwitch
WEnd



Func ScrollRight()
    _GUIScrollBars_SetScrollInfoPos($hParent, $SB_HORZ, _GUIScrollBars_GetScrollInfoPos($hParent, $SB_HORZ) + 5)
EndFunc

Func ScrollLeft()
    _GUIScrollBars_SetScrollInfoPos($hParent, $SB_HORZ, _GUIScrollBars_GetScrollInfoPos($hParent, $SB_HORZ) - 5)
EndFunc

 

Link to post
Share on other sites
1 hour ago, pixelsearch said:

HiAaron,
You shouldn't use at same time $WS_CHILD and $WS_EX_MDICHILD
Have you tried it like this ?

$hChild = GUICreate("Child", 100, 100, -1,-1, $WS_CHILD , -1, $hParent)

 

Thank you , it works now!  😄

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...