(http://bwpkb.img38.wal8.com/img38/397073_20131226203745/138810569724.jpg)
hi all,
as you see in the picture, there are 15 checkboxs in a combobox.
when selected multiple items, all the selected index(or text) will show in the text area of the combobox
how to do this? any example?
if i was just starting out, i would do it this way....
write a simple program with just a combo box
learn how to place and retrieve text in the edit control
learn how to place text in the drop-down
make another simple program with just check boxes (which are actually a button style)
learn how to put text on them
learn how the mouse events to check/uncheck the boxes send messages to the application
then - write the program with both
hi dedndave,
i think the difficult part is handle WM_DRAWITEM message and create a number of checkboxes
that should only be required for an owner-drawn box
http://msdn.microsoft.com/en-us/library/windows/desktop/bb775792%28v=vs.85%29.aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/bb775792%28v=vs.85%29.aspx)
\Masm32\Examples\dialogs_later\lists
\Masm32\Examples\exampl04\jacts
i would post an example, but the one i have - the combobox us subclassed
that would just make things difficult for a beginner :P
i used olly reversed the software, found the author did not create checkbox.
he used CopyRect to draw the check/uncheck rectangle
used GetSysColor、SetBkColor、SetTextColor、ExtTextOut、TextOut to handle WM_DRAWITEM
so the problems left are multiple check and set the edit text in combobox, because when clicked a item, the dropdown list will be invisible.
Have a look at the latest Event Viewer filter dialog to see why a combobox with checkboxes is a bad idea. You actually have to click off the combobox to close it.
Haven't listboxes got a checkbox style? Much better for the user, an edit and a listbox.
Quote from: sinsi on December 27, 2013, 06:17:50 PM
Have a look at the latest Event Viewer filter dialog to see why a combobox with checkboxes is a bad idea. You actually have to click off the combobox to close it.
Haven't listboxes got a checkbox style? Much better for the user, an edit and a listbox.
hi sinsi,
i just want to improve my coding skill .
i didn't know how to deal with OwnerDraw contorls, i think it's the same to all beginners
when i see the "magic" control, i have a strong desire to figure out how it works.
now i know there are NO real checkboxes , so i think the fake checkboxes in a combobox is not a bad idea
when i figure all things out , i will show my code.
Hey
Here is a good Ownerdraw Listbox example with checkboxes
A Listbox is similar to Combobox you must replace the windows Messages
Example
LB_SETITEMDATA to CB_SETITEMDATA
...
..
And Test it
http://www.masmforum.com/archive2012/8260_ODListBox.zip
or look in radasm source addin Manager
Quote from: ragdog on December 27, 2013, 07:50:41 PM
Hey
Here is a good Ownerdraw Listbox example with checkboxes
A Listbox is similar to Combobox you must replace the windows Messages
Example
LB_SETITEMDATA to CB_SETITEMDATA
...
..
And Test it
http://www.masmforum.com/archive2012/8260_ODListBox.zip
or look in radasm source addin Manager
wow, this is exactly what i want. thank you ragdog
Exactly what you want?
i have think you want it for a combobox?
Ok is not difficult to change it for a Cbo
Quote from: ragdog on December 27, 2013, 08:26:19 PM
Exactly what you want?
i have think you want it for a combobox?
Ok is not difficult to change it for a Cbo
i mean the method. yes i need to do some changes.
the fact that the original program used rectangles to draw checkboxes is ok
but - that's somewhat of an advanced technique
for a beginner, just use buttons with the proper style bits
Right dave
But is easy to understand i have a other from Ernest Murphy && NaN
but is better only not easy to understand
hi all,
i have done the job ! :biggrin:
please have a look at my code.
(http://bwpkb.img38.wal8.com/img38/397073_20131226203745/138818631518.jpg)
ESI, EDI and EBX are nonvolatile registers and must preserved by call-back functions (e.g. Dlg/WndProc)