- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
i am selecting an item in a listbox. some times this item is only shown partly in the listbox (see picture). i am using LB_SETSEL in a win32 Environment.

is there a possibility to center the selected item? Only one item is selected.
Thanks in advance
Frank
i am selecting an item in a listbox. some times this item is only shown partly in the listbox (see picture). i am using LB_SETSEL in a win32 Environment.
is there a possibility to center the selected item? Only one item is selected.
Thanks in advance
Frank
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
("i am" == "the user is" or "my program is"?)
Perhaps use LB_SETTOPINDEX with an appropriate offset of items to get your desired item in the middle.
Perhaps use LB_SETTOPINDEX with an appropriate offset of items to get your desired item in the middle.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
("i am" == "the user is" or "my program is"?)
Perhaps use LB_SETTOPINDEX with an appropriate offset of items to get your desired item in the middle.
Perhaps use LB_SETTOPINDEX with an appropriate offset of items to get your desired item in the middle.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello IanH,
during developing time
i am ==
a) writing the source code
b) starting the program
c) pressing the button
what means that 'some times' the computer might do what i have intended ;-)
LB_SETTOPINDEX works for me
Frank
during developing time
i am ==
a) writing the source code
b) starting the program
c) pressing the button
what means that 'some times' the computer might do what i have intended ;-)
LB_SETTOPINDEX works for me
Frank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The reason why I was asking for clarification about who or what was selecting the item is that a user is going to get pretty cranky pretty quickly if items in listboxes start jumping around whenever they change the selection directly in the listbox, as opposed to the selection being set by the program in response to non-user input or user actions remote from the listbox (perhaps selecting the item as part of the initialisation of the dialog box or as the result of clicking on a button elsewhere), where having the selected item appearing in the right spot makes a great deal of sense.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the change of the selected item is caused be a user action searching for a certain entry in the listbox. Therefor jumping around is intended and hopefully accepted by the user.
Frank
Frank

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page