CListBox how to set single selection?
-
Hi all, I have CListBox with selection set to Extended in resource editor. In my prog I need to set selection to single. Please point me, how can I do this?
Remove the
LBS_MULTIPLESEL
style.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Remove the
LBS_MULTIPLESEL
style.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Remove the
LBS_MULTIPLESEL
style.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Romiks wrote:
This one doesn't work
How are you verifying this? After this runs, you should be able to use Spy++ to see the list of styles that particular control has. You should see
LBS_EXTENDEDSEL
andLBS_MULTIPLESEL
in that list. Of course if you want the control to be single-select, I doubt that adding theLBS_MULTIPLESEL
style will work. ;)
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Romiks wrote:
This one doesn't work
How are you verifying this? After this runs, you should be able to use Spy++ to see the list of styles that particular control has. You should see
LBS_EXTENDEDSEL
andLBS_MULTIPLESEL
in that list. Of course if you want the control to be single-select, I doubt that adding theLBS_MULTIPLESEL
style will work. ;)
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
Ok, I did single select ListBox and trying to add styles like this:
m_listFiles.ModifyStyle( 0, LBS_EXTENDEDSEL | LBS_MULTIPLESEL ); m_listFiles.UpdateWindow();
SPY shows me LBS_EXTENDEDSEL and LBS_MULTIPLESEL styles present, but actually the list is single select :confused: -
Ok, I did single select ListBox and trying to add styles like this:
m_listFiles.ModifyStyle( 0, LBS_EXTENDEDSEL | LBS_MULTIPLESEL ); m_listFiles.UpdateWindow();
SPY shows me LBS_EXTENDEDSEL and LBS_MULTIPLESEL styles present, but actually the list is single select :confused:Then you may have found a style that cannot be altered at run-time. There are several.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Then you may have found a style that cannot be altered at run-time. There are several.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
What about not using ModifyStyle? I mean get the style, style = style | ~NonDesiredMode and SetStyle (style) another time... can it work?
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
-
Then you may have found a style that cannot be altered at run-time. There are several.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
What about not using ModifyStyle? I mean get the style, style = style | ~NonDesiredMode and SetStyle (style) another time... can it work?
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Nelek wrote:
can it work?
Why not try it and see?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne