Sign in to follow this  
Followers 0
pancwk

Function Return Value Into Listview

3 posts in this topic

I want put my custom function return value ( $TicketNo = fetchTicketNum() ) into a listview or list, and tried many ways,just could not figure it out how to do that. The following are my codes. Could any body help me? Thanks a lot!! pancwk

#include <GUIConstants.au3>

AutoItSetOption("WinTitleMatchMode", 4)

Opt("MouseCoordMode", 0) ;1=absolute, 0=relative, 2=client

AutoItSetOption("WinDetectHiddenText", 1)

Opt("GUIOnEventMode", 1) ; Change to OnEvent mode

$TicketNo = fetchTicketNum()

GUICreate("Trades Monitor",300,500, 100,200,-1,$WS_EX_ACCEPTFILES)

GUISetBkColor (0x00E0FFFF) ; will change background color

$button1 = GuiCtrlCreateButton ("Enable AutoTrade",10,450)

GUICtrlSetOnEvent($button1, "enableAT")

$button2 = GuiCtrlCreateButton ("Disable AutoTrade",150,450)

GUICtrlSetOnEvent($button2, "disableAT")

$listview = GuiCtrlCreateListView ("col1|col2|col3 ",10,10,280,400)

$item1=GuiCtrlCreateListViewItem("item1|col22|col23",$listview)

$item2=GuiCtrlCreateListViewItem("............item1|col12|col13",$listview)

$item3=GuiCtrlCreateListViewItem("item3|col32|col33",$listview)

GUICtrlSetData($item2,"|$TicketNo")

GuiSetState(@SW_SHOW)

Share this post


Link to post
Share on other sites



try something like (requires beta)

#include <GUIConstants.au3>
#include <GuiListView.au3>

AutoItSetOption("WinTitleMatchMode", 4)
Opt("MouseCoordMode", 0);1=absolute, 0=relative, 2=client
AutoItSetOption("WinDetectHiddenText", 1)
Opt("GUIOnEventMode", 1); Change to OnEvent mode 


$TicketNo = fetchTicketNum()

GUICreate("Trades Monitor",300,500, 100,200,-1,$WS_EX_ACCEPTFILES)
GUISetBkColor (0x00E0FFFF); will change background color

$button1 = GuiCtrlCreateButton ("Enable AutoTrade",10,450)
GUICtrlSetOnEvent($button1, "enableAT")

$button2 = GuiCtrlCreateButton ("Disable AutoTrade",150,450)
GUICtrlSetOnEvent($button2, "disableAT")

$listview = GuiCtrlCreateListView ("col1|col2|col3 ",10,10,280,400)

$item1=GuiCtrlCreateListViewItem("item1|col22|col23",$listview)
$item2=GuiCtrlCreateListViewItem("............item1|col12|col13",$listview)
$item3=GuiCtrlCreateListViewItem("item3|col32|col33",$listview)
_GUICtrlListViewSetItemText($listview,1,0,$TicketNo)
GuiSetState(@SW_SHOW)

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Dear gafrost, thank you very much. I tried your way and it works. Thanks! pancwk

Share this post


Link to post
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
Sign in to follow this  
Followers 0