Jump to content

ListView read and click problem


bogQ
 Share

Recommended Posts

I got lost in help file and large script that is mostly based on large amounts of ListView

can someone tell me how to solve this problem

when i double click on listview item i get results like i clicked button, apparently ID is pulling button ID, i know i can put GUICtrlCreateListViewItem after all controls and itl probably solwe it if im not wrong but im wondering is there some alternative that can help me to read data from ListView that isn't with GUICtrlRead(GUICtrlRead($GG2_LW2)) ?

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <GuiListView.au3>
Dim $aRecords1
$GG2 = GUICreate('G1',800-230,600,230,0,$WS_POPUP,$WS_EX_TOOLWINDOW+$WS_EX_TOPMOST)
GUISetFont(10,800)
$GG2_LW2 = GUICtrlCreateListView("", 270, 7, 250, 513)
_GUICtrlListView_AddColumn($GG2_LW2, "ID_V", 60)
_GUICtrlListView_AddColumn($GG2_LW2, "Name2", 180)
GUICtrlCreateListViewItem('ww'&'|'&'gg'&'|'&'bb', $GG2_LW2)
$GG2_BT1_Change = GUICtrlCreateButton('get it', 800-230-240,550,200,30)
GUICtrlCreateGroup('', 0, -8, 570, 608)
GUISetState(@SW_SHOW,$GG2)
 
While 1
$msg = GUIGetMsg()
Switch $msg
  Case $GUI_EVENT_CLOSE
   Exit
  Case $GG2_BT1_Change
   ConsoleWrite('LW2='&GUICtrlRead(GUICtrlRead($GG2_LW2))&@CRLF)
EndSwitch
WEnd

edit

hmm.. thing i got the problem, creating 2 colums but adding 3 colum data O_o

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

  • Moderators

bogQ,

Try not to mix native and UDF functions - not all of the UDF ones work with native created ListViews. ;)

I got the 3 columns to show like this:

$GG2_LW2 = GUICtrlCreateListView("|ID_V|Name2", 270, 7, 250, 513)
_GUICtrlListView_SetColumnWidth($GG2_LW2, 0, 60)
_GUICtrlListView_SetColumnWidth($GG2_LW2, 1, 60)
_GUICtrlListView_SetColumnWidth($GG2_LW2, 2, 180)

Why do you not want to use GUICtrlRead(GUICtrlRead($GG2_LW2))? I agree it is clumsy, but it works. :graduated:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...