 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Labouche10
Joined: 28 Nov 2007 Posts: 17 Location: Missouri, USA
|
Posted: Sun Jan 13, 2008 9:42 pm Post subject: Help with ListView specifically LV_Add() |
|
|
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 |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1186 Location: switzerland
|
Posted: Sun Jan 13, 2008 10:14 pm Post subject: |
|
|
| maybe try first add button then add listview (?) |
|
| Back to top |
|
 |
Labouche10
Joined: 28 Nov 2007 Posts: 17 Location: Missouri, USA
|
Posted: Mon Jan 14, 2008 2:19 am Post subject: |
|
|
| OK I tried that but it didn't make a difference. Does anyone have any other suggestions? Thanks |
|
| Back to top |
|
 |
Labouche10
Joined: 28 Nov 2007 Posts: 17 Location: Missouri, USA
|
Posted: Mon Jan 14, 2008 2:36 am Post subject: |
|
|
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 |
|
 |
Guest
|
Posted: Mon Jan 14, 2008 3:20 am Post subject: |
|
|
| 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
|
Posted: Mon Jan 14, 2008 4:10 am Post subject: |
|
|
| Ahhh that did it! Thank you for the help!!! |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|