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 

Help with ListView specifically LV_Add()

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



Joined: 28 Nov 2007
Posts: 17
Location: Missouri, USA

PostPosted: Sun Jan 13, 2008 9:42 pm    Post subject: Help with ListView specifically LV_Add() Reply with quote

Man am I at wits end... I've read the help file and about a dozen forum posts but still can't seem to get anywhere. Here is the portion of the code that isn't working:

Gui, 2:Add, Listview, +vlistboxlicensee +grid +nosort -wantF2, ItemNum|LicPrice

Loop, % linevar - 1
LV_Add("", itemnumvar%A_Index%,field%A_Index%2)

Gui, 2:Add, Button, +Gsublicenseepriceproceed Section, OK
Gui, 2:Add, Button, +Gsubcancel2 +ys, Cancel
Gui, 2:Show, , Press OK to continue

When I add a MsgBox to the code like this:
Gui, 2:Add, Listview, +vlistboxlicensee +grid +nosort -wantF2, ItemNum|LicPrice

Loop, % linevar - 1
{
Msgbox, % itemnumvar%A_Index% . " " . field%A_Index%2
LV_Add("", itemnumvar%A_Index%,field%A_Index%2)
}
Gui, 2:Add, Button, +Gsublicenseepriceproceed Section, OK
Gui, 2:Add, Button, +Gsubcancel2 +ys, Cancel
Gui, 2:Show, , Press OK to continue

I get a message box every time with the values of itemnumvar%A_Index% and field%A_Index%2. Why isn't LV_Add() working?

The listview just shows up blank. At least the columns are named properly.

Thank for any help in advance!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
garry



Joined: 19 Apr 2005
Posts: 1186
Location: switzerland

PostPosted: Sun Jan 13, 2008 10:14 pm    Post subject: Reply with quote

maybe try first add button then add listview (?)
Back to top
View user's profile Send private message
Labouche10



Joined: 28 Nov 2007
Posts: 17
Location: Missouri, USA

PostPosted: Mon Jan 14, 2008 2:19 am    Post subject: Reply with quote

OK I tried that but it didn't make a difference. Does anyone have any other suggestions? Thanks
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Labouche10



Joined: 28 Nov 2007
Posts: 17
Location: Missouri, USA

PostPosted: Mon Jan 14, 2008 2:36 am    Post subject: Reply with quote

OK I just figured something out but still need help. When I changed my code from Gui:2 to just Gui it works! That is weird. I would prefer to keep both windows at the same time. Anyone have any ideas? Here is my code now:


Code:
gui, destroy
Gosub, subselectfile
Gosub, subfileread
Sleep, 150
Gui, Add, Button, +Gsublicenseepriceproceed Section, OK
Gui, Add, Button, +Gsubcancel2 +ys, Cancel
Gui, Add, Listview, +vlistboxlicensee +grid +nosort -wantF2, ItemNum|LicPrice
Loop, % linevar - 1
   LV_Add("", itemnumvar%A_Index%, field%A_Index%2)
Gui, Show, , Press OK to continue
Return


Any ideas?[/code]
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Guest






PostPosted: Mon Jan 14, 2008 3:20 am    Post subject: Reply with quote

Labouche10 wrote:
When I changed my code from Gui:2 to just Gui it works!

...leave the Gui lines as Gui (not Gui, 2:)...but add Gui, 2:Default, before all the 2nd Gui commands...& use Gui, 1:Default if you have problems using Gui 1 later...like...

Code:
Gui, 2:Default
Gui, Add, Listview
LV_Add()

Gui, 1:Default
;///...etc...
Back to top
Labouche10



Joined: 28 Nov 2007
Posts: 17
Location: Missouri, USA

PostPosted: Mon Jan 14, 2008 4:10 am    Post subject: Reply with quote

Ahhh that did it! Thank you for the help!!!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
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