Jump to content

Regarding GUICTRLCREATELIST


rizwan
 Share

Recommended Posts

I am trying to display the button I press on a screen on the SAME GUI. However they only show one time on the screeen. I want them to continually show it on screen. for example if I press x 3 times i want to see it on screen 3 times. Below is my code. Please help.

$mylist=GUICtrlCreateList ("", 176,32,121,97, $LBS_DISABLENOSCROLL )

$button_1 = GUICtrlCreateButton ("x", 210, 190, 60)

$button_2 = GUICtrlCreateButton ("y", 210, 230, 60)

$button_3 = GUICtrlCreateButton ("Clear", 210, 270, 60)

GUISetState ()

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

Select

Case $msg = $button_1 ; x

GUICtrlSetData($mylist,"x")

Case $msg = $button_2 ; y

GUICtrlSetData($mylist,"y")

case $msg = $button_3

GUICtrlSetData($mylist,"")

Case $msg = $GUI_EVENT_CLOSE

;MsgBox(0, "", "Dialog was closed")

Exit

EndSelect

WEnd

Link to comment
Share on other sites

I am trying to display the button I press on a screen on the SAME GUI. However they only show one time on the screeen. I want them to continually show it on screen. for example if I press x 3 times i want to see it on screen 3 times. Below is my code. Please help.

$mylist=GUICtrlCreateList ("", 176,32,121,97, $LBS_DISABLENOSCROLL )

$button_1 = GUICtrlCreateButton ("x", 210, 190, 60)

$button_2 = GUICtrlCreateButton ("y", 210, 230, 60)

$button_3 = GUICtrlCreateButton ("Clear", 210, 270, 60)

GUISetState ()

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

Select

Case $msg = $button_1 ; x

GUICtrlSetData($mylist,"x")

Case $msg = $button_2 ; y

GUICtrlSetData($mylist,"y")

case $msg = $button_3

GUICtrlSetData($mylist,"")

Case $msg = $GUI_EVENT_CLOSE

;MsgBox(0, "", "Dialog was closed")

Exit

EndSelect

WEnd

in your setdata's you're passing only a literal string, not adding to the original, modify them so that they're like:

GUICtrlSetData($mylist,GUICtrlRead($mylist) & "x")
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...