thegreatjedi Posted October 15, 2018 Share Posted October 15, 2018 I'm trying to implement ListBoxes in my GUI, and am reading the API reference for _GUICtrlListBox_Create parameters. I do not understand these particular styles: $LBS_EXTENDEDSEL - Allows multiple items to be selected $LBS_HASSTRINGS - Specifies that a list box contains items consisting of strings $LBS_MULTIPLESEL - Turns string selection on or off each time the user clicks a string $LBS_NODATA - Specifies a no-data list box First question: For $LBS_NODATA, does it mean that the listbox CAN be empty, or it can ONLY be empty? Second question: What is the purpose of $LBS_HASSTRINGS ? Aren't all listbox values strings? Why is it necessary to specify this style option? What's the implications of checking and unchecking it? Third question: What's the difference between $LBS_EXTENDEDSEL and $LBS_MULTIPLESEL when it comes to allowing multiple listbox items to be selected? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 15, 2018 Moderators Share Posted October 15, 2018 (edited) thegreatjedi, The Google force was evidently not with you! Looking on MSDN gives the following more detailed explanations: Quote LBS_EXTENDEDSEL The user can select multiple items using the SHIFT key and the mouse or special key combinations. LBS_MULTIPLESEL String selection is toggled each time the user clicks or double-clicks the string. Any number of strings can be selected So it seems that the first style requires an additional key/s to be pressed to select multiple items whereas the second style will select multiple items simply by using the mouse. Quote LBS_HASSTRINGS Specifies an owner-draw list box that contains items consisting of strings. The list box maintains the memory and pointers for the strings so the application can use the GetText member function to retrieve the text for a particular item. LBS_NODATA Specifies a no-data list box. Specify this style when the count of items in the list box will exceed one thousand. A no-data list box must also have the LBS_OWNERDRAWFIXED style, but must not have the LBS_SORT or LBS_HASSTRINGS style. A no-data list box resembles an owner-drawn list box except that it contains no string or bitmap data for an item. Commands to add, insert, or delete an item always ignore any given item data; requests to find a string within the list box always fail. The system sends the WM_DRAWITEM message to the owner window when an item must be drawn. The itemID member of the DRAWITEMSTRUCT structure passed with the WM_DRAWITEM message specifies the line number of the item to be drawn. A no-data list box does not send a WM_DELETEITEM message. These styles refer to owner-drawn listboxes, which are far more complicated then the standard controls usually used in AutoIt - so in my view they can safely be ignored by us normal users. M23 Edited October 15, 2018 by Melba23 Wrong button too soon FrancescoDiMuro 1 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...
thegreatjedi Posted October 15, 2018 Author Share Posted October 15, 2018 @Melba23 Thanks! I Google'd these styles but all I got is the online AutoIT reference and posts from this forum which don't elaborate on what these do. I haven't seen a single link related to msdn. After all the stuff I've been doing I'm starting to believe they need to be clearer on what is defined by AutoIT and what is actually defined by Windows itself... Quote These styles refer to owner-drawn listboxes, which are far more complicated then the standard controls usually used in AutoIt - so in my view they can safely be ignored by us normal users. So I can use $LBS_MULTIPLESEL without specifying $LBS_HASSTRINGS ? I got confused by some other thread in this forum, that the tool must go hand in hand to work. 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