BinaryBrother Posted March 12, 2009 Share Posted March 12, 2009 (edited) Func ViewInventory() $ViewInventory = GUICreate("Inventory View", 600, 440, 193, 125, -1, $WS_EX_ACCEPTFILES) $listview = GUICtrlCreateListView("Item# | Product |Usable|Total Unusable", 0, 0, 600, 440,$LVS_NOLABELWRAP,$LVS_EX_GRIDLINES) $ProductInfo = IniReadSection(@ScriptDir & "\Inventory\Inventory.ini", "Inventory") For $N = 1 To $ProductInfo[0][0] I would post the entire thing, but it's 3000+ lines, and those are the relevant lines... lol. I'm having a terrible time getting the Product Tab over, as you can see by the mass spaces after | Product, which was a failed attempt, but close.. I don't want to expand it every time I was to see the full product name... I've searched and modified all relevant styles, and can't seem to figure it out... Any help is highly appreciated, screen-shot is attached as well... Edited March 12, 2009 by BinaryBrother SIGNATURE_0X800007D NOT FOUND Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 12, 2009 Moderators Share Posted March 12, 2009 BinaryBrother,Try creating your ListView with simple headers ("Item#|Product|Usable|Total Unusable") and then use _GUICtrlListView_SetColumnWidth with the $LVSCW_AUTOSIZE style. It has worked for me in the past. But be careful or you may end up running out of space in the GUI to show the right hand columns. :-)If you can accepts a variable sized GUI, there is a way to see how big it would have to be for all columns to fit. You would have to play with this a bit, but the principle is pretty clear:$iWidth = 0 For $i = 0 To $Last_Col GUICtrlSendMsg($hListView, $LVM_SETCOLUMNWIDTH, $i, $LVSCW_AUTOSIZE) $iWidth += GUICtrlSendMsg($hListView, $_ARRAYCONSTANT_LVM_GETCOLUMNWIDTH, $i, 0) Next WinMove($hGUI, "", Default, Default, $iWidth + 20)I hope this helps.M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
BinaryBrother Posted March 12, 2009 Author Share Posted March 12, 2009 For some reason I couldn't get the $LVSCW_AUTOSIZE to work... Not syntax error, it just cramped all my columns to like 10px width... Anyway, I DID however get your CtrlSend to work for a manual resize. You are truly appreciated! GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 1, 210) SIGNATURE_0X800007D NOT FOUND Link to comment Share on other sites More sharing options...
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