• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 229
  • Last Modified:

Selectable text in a List Box control

I want to know how to make a regular list box control, except you can select text that is in the control.  I'm not using MFC, just regular win32.
1 Solution
// Create a list box
hWndList = CreateWindow("listbox",NULL, WS_CHILD|
WS_VISIBLE|LBS_STANDARD, 400,50,iWidth+10 ,iHeight+50, hWnd,
(HMENU)"", hInst, NULL);

with resource editor it would be straight forward, drag n drop. :)

If you mean the text in the list box needs to be selected character-wise like an edit box, that is very difficult to achive with a list box.  It would probably be easier to make a read-only multiline edit box and just respond to the sel change message to prevent the user from doing selections that you don't want.

Hope this helps.

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now