AutoHotkey Community

It is currently May 27th, 2012, 7:02 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: March 10th, 2006, 10:14 pm 
Offline

Joined: December 3rd, 2005, 1:57 am
Posts: 8
Hi all,

How can I get code A to behave like code B? Specifically: how do I make it populate the ListView control before the user clicks on it?

Code A:
Code:
   Gui, 7:Add, ListView, gInteract_with_LV  ,Col1|Col2
   gui, 7:show

   Gosub Populate_LV   
   
return

Interact_with_LV:
   if A_GuiEvent = DoubleClick
      Gosub Populate_LV
return


Populate_LV:   
   LV_Add("", "Hi there")
return


Code B:
Code:
   Gui, Add, ListView, gInteract_with_LV  ,Col1|Col2
   gui, show

   Gosub Populate_LV   
   
return

Interact_with_LV:
   if A_GuiEvent = DoubleClick
      Gosub Populate_LV
return


Populate_LV:   
   LV_Add("", "Hi there")
return


Cheers


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2006, 10:25 pm 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
You need to tell the script which gui the listview is in by making the following change:

Code:
Populate_LV:   
   Gui, 7: Default
   LV_Add("", "Hi there")
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 11th, 2006, 12:13 am 
Offline

Joined: December 3rd, 2005, 1:57 am
Posts: 8
Thanks!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot], Google [Bot], migz99, sjc1000, Yahoo [Bot] and 80 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group