Jump to content

Recommended Posts

Posted

Hello, I can't figure this out. I want to create a small child gui within a parent gui containing a label. My label isn't displaying it's text. Please help my ignorance.

#include <WindowsConstants.au3>

;parent gui
$doc = GUICreate("", 333, 750, 686, 1)
  GUISetBkColor(0xffffff)

;conditions
 $currentConditions = "Snow this morning will become heavy at times this afternoon. Some sleet may mix in. High 31F. Winds E at 10 to 20 mph. 6 to 10 inches of snow expected."

  $conditions = GUICtrlCreateLabel($currentConditions, 70, 25, 750, 15)
  GUICtrlSetColor(-1,0x000000) ; black
  GUICtrlSetTip(-1,"Current Weather Conditions")

;display parent gui
GUISetState(@SW_SHOW, $doc)

;child gui, static label displaying text "Conditions: "
  $condLabelGui = GUICreate("", 60, 15, 0, 25,$WS_POPUP, $WS_EX_MDICHILD, $doc)
  $condLabel = GUICtrlCreateLabel("Conditions: ", 2, 25, 58, 13)

GUISetState(@SW_SHOW, $condLabelGui)

While 1
 ;scroll conditions label
    scrollconditions()

  $nMsg = GUIGetMsg()
  Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
  EndSwitch

  sleep(1000)
WEnd

func scrollConditions()
  While 1
    For $x = 100 to -600 step -2
       ControlMove ($doc,"",$conditions, $x, 25)
       Sleep(30)
    Next
    exitloop
  WEnd
endfunc
Posted

Geez, that's what I get for copying my $conditions label from the parent gui into the child gui (and thinking too much about the partent gui and not enough about the child gui). Thanks, Tomb!

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...