AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[solved]ListBox : no replace value with GuiControl

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Jeannot40



Joined: 19 Jul 2008
Posts: 4

PostPosted: Sat Jul 19, 2008 4:12 pm    Post subject: [solved]ListBox : no replace value with GuiControl Reply with quote

Hello all

I am trying to write an application launcher. I have a problem to change the show list in a ListBox with GuiControl : the new list doesnt replace the old list but it's appended at the old values in the ListBox.

I have written a simplified code to expose my problem
Code:

#NoTrayIcon

#NoEnv 
SendMode Input 
SetWorkingDir %A_ScriptDir% 

items = menu1|menu2|menu3

   ;init window
   Gui, Font, S12 CDefault, Arial                       
   Gui, Add, Text, x6 y10 w250 h20, Choose an Application
   Gui, Add, ListBox, vChoice w500 h300 hscroll vscroll AltSubmit
   Gui, Add, Button, vSend gValideMenu x110 y340 w60 h21 +Default, &Send
   Gui, Add, Button, vCancel gGuiClose x260 y340 w60 h21, Cancel
   Gosub ShowMainWindow
 
   Escape::
        Gosub GuiClose
   return

ShowMainWindow:   
   GuiControl, , Choice, %items%
   Gui, Show,,   Mainmenu
return

ValideMenu:
      Gui, submit,                               
      GuiControlGet, Choice                     
      items = appli1 menu%Choice%|appli2 menu%Choice%|appli3 menu%Choice%
     Gosub ShowMainWindow                         

return

GuiClose:
   Gui cancel
   GuiEscape:
   ExitApp


Please help me; I search , I try but don't found


Last edited by Jeannot40 on Sat Jul 19, 2008 4:35 pm; edited 1 time in total
Back to top
View user's profile Send private message
HugoV



Joined: 27 May 2007
Posts: 499

PostPosted: Sat Jul 19, 2008 4:22 pm    Post subject: Reply with quote

start your new list with a | to clear the old values.
Code:
items = |appli1 menu%Choice%|appli2 menu%Choice%|appli3 menu%Choice%
Back to top
View user's profile Send private message
Jeannot40



Joined: 19 Jul 2008
Posts: 4

PostPosted: Sat Jul 19, 2008 4:33 pm    Post subject: Reply with quote

Fine Very Happy Very Happy Very Happy

Thank you very much : this is works perfectly
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group