Aceguy Posted March 13, 2008 Posted March 13, 2008 is there anyway to lock the last column to the right hand side of the listview. (no moveable bar) cos there is always a blank space after the last column. many thanks [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
rasim Posted March 13, 2008 Posted March 13, 2008 Hi! Example: expandcollapse popup#include <GuiListView.au3> #include <GuiImageList.au3> #include <GuiConstantsEx.au3> Global Const $HDN_FIRST = -300 Global Const $HDN_ITEMCHANGINGA = $HDN_FIRST - 0 Global Const $HDN_BEGINTRACKA = $HDN_FIRST - 6 $Gui = GUICreate("Test", 320, 220) $hListView = _GUICtrlListView_Create($GUI, "Items|SubItems1|SubItems2", 10, 10, 300, 200, BitOR($LVS_EDITLABELS, $LVS_REPORT), $WS_EX_CLIENTEDGE) _GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_SUBITEMIMAGES, $LVS_EX_FULLROWSELECT)) _GUICtrlListView_SetColumnWidth($hListView, 0, 98) _GUICtrlListView_SetColumnWidth($hListView, 1, 98) _GUICtrlListView_SetColumnWidth($hListView, 2, 80) $hImage = _GUIImageList_Create(16, 16, 5, 3) _GUIImageList_AddIcon ($hImage, "shell32.dll", 3) _GUIImageList_AddIcon ($hImage, "shell32.dll", 11) _GUIImageList_AddIcon ($hImage, "shell32.dll", 22) _GUIImageList_AddIcon ($hImage, "shell32.dll", 33) _GUICtrlListView_SetImageList($hListView, $hImage, 1) _GUICtrlListView_AddItem($hListView, "Item1",0) _GUICtrlListView_AddItem($hListView, "Item2",2) _GUICtrlListView_AddItem($hListView, "Item3",1) _GUICtrlListView_AddItem($hListView, "Item4",3) _GUICtrlListView_AddSubItem ($hListView, 0,'44', 1, 2) _GUICtrlListView_AddSubItem ($hListView, 1,'22', 1, 1) _GUICtrlListView_AddSubItem ($hListView, 2,'11', 1, 0) _GUICtrlListView_AddSubItem ($hListView, 3,'33', 1, 3) _GUICtrlListView_AddSubItem ($hListView, 0,'New', 2, 1) _GUICtrlListView_AddSubItem ($hListView, 1,'Page', 2, 3) _GUICtrlListView_AddSubItem ($hListView, 2,'Sys', 2, 2) _GUICtrlListView_AddSubItem ($hListView, 3,'Device', 2, 0) GUISetState() GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ;------------------------------------------------------------------------------ ;----------------------------------------------------------------------------------- Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $tNMHDR, $iCode, $tInfo, $iItem $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $iCode = DllStructGetData($tNMHDR, "Code") Switch $iCode Case $HDN_ITEMCHANGINGA, $HDN_BEGINTRACKA $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam) $iItem = DllStructGetData($tInfo, "Item") If $iItem = _GUICtrlListView_GetColumnCount($hListView) - 1 Then Return 1 EndSwitch Return $GUI_RUNDEFMSG EndFunc
Aceguy Posted March 13, 2008 Author Posted March 13, 2008 (edited) EXCELLENT, just what i was looking for. What does the Func do.? Check for whats being selected.? thank you. /salute Edited March 13, 2008 by Aceguy [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now