 |
|
 |
Very kind of you if adding some features :
- Delete all items to add new items or change text of an item. When data change, content of combo box would change on fly !
- Set item/ items read-only : user cannot change checked/unchecked state of the item
- ...
if(artical == IDOK)
it's mine;
else
i don't know;
|
|
|
|
 |
|
 |
Can anyone tell me how to use this control on a dialog bar ?
I try in this way but I failed :
CCheckComboBox* pCombo = (CCheckComboBox*)m_wndDialogbar.GetDlgItem(IDC_COMBO1);
pCombo->AddString("abc");
pCombo->SetCheck(0,TRUE);
|
|
|
|
 |
|
 |
Can you give a new CCheckComboBox version base on VC2008
|
|
|
|
 |
|
 |
Do anyone know why SELCHANGE was called twice? Thanks in advance.
|
|
|
|
 |
|
 |
Hi,
I have used this CCheckComboBox-control in my project. It works fine in XP (32-bit and 64-bit). It works also on 32-bit Vista. For some reason it doesn't work on 64-bit Vista. I can't check or uncheck any checkbox in dropdown list. I can create list and dropdown system also works but (un)checking just doesn't work.
I debugged this so far that class seems to do the subclassing of listabox i.e. it seems to register the message handler function (ComboBoxListBoxProc-function on CCheckComboBox::OnCtlColorListBox -method). But there won't be any messages (WM_CHAR or WM_LBUTTONDOWN) to handle (as it happens on working platforms when I click listbox and do the checking/unchecking).
I had also fix the code that it would compile on 64-bit platform:
LRESULT CCheckComboBox::OnCtlColorListBox(WPARAM wParam, LPARAM lParam)
{
if (m_hListBox == 0) {
HWND hWnd = (HWND)lParam;
if (hWnd != 0 && hWnd != m_hWnd) {
m_hListBox = hWnd;
#ifdef _WIN64
m_pWndProc = (WNDPROC)GetWindowLong(m_hListBox, GWLP_WNDPROC);
SetWindowLong(m_hListBox, GWLP_WNDPROC, (LONG)ComboBoxListBoxProc);
#else
m_pWndProc = (WNDPROC)GetWindowLong(m_hListBox, GWL_WNDPROC);
SetWindowLong(m_hListBox, GWL_WNDPROC, (LONG)ComboBoxListBoxProc);
#endif
}
}
return DefWindowProc(WM_CTLCOLORLISTBOX, wParam, lParam);
}
I use currently MS Visual C++ 2008. I have had CCheckComboBox-control working also with VC++ 2003 and 2005 versions on XP 32-bit.
Any help would be preciated...
|
|
|
|
 |
|
 |
Following code seems to work, you had to change function names GetWindowLong -> GetWindowLongPtr and
SetWindowLong -> SetWindowLongPtr
LRESULT CCheckComboBox::OnCtlColorListBox(WPARAM wParam, LPARAM lParam)
{
if (m_hListBox == 0) {
HWND hWnd = (HWND)lParam;
if (hWnd != 0 && hWnd != m_hWnd) {
m_hListBox = hWnd;
#ifdef _WIN64
m_pWndProc = (WNDPROC)GetWindowLongPtr(m_hListBox, GWLP_WNDPROC);
SetWindowLongPtr(m_hListBox, GWLP_WNDPROC, (LONG_PTR)ComboBoxListBoxProc);
#else
m_pWndProc = (WNDPROC)GetWindowLong(m_hListBox, GWL_WNDPROC);
SetWindowLong(m_hListBox, GWL_WNDPROC, (LONG)ComboBoxListBoxProc);
#endif
}
}
return DefWindowProc(WM_CTLCOLORLISTBOX, wParam, lParam);
}
|
|
|
|
 |
|
 |
Can any one help me using this control in ATL?
Raj
|
|
|
|
 |
|
 |
Hi, Is there an equivalent for c# ? I have the same requirement for a drop down with check boxes, but cannot find an example in c#. Any help will be greatly appreciated.
Thanks!
Mrinal
Developer
|
|
|
|
 |
|
 |
I do not use C# so I am not aware of an equivelant control. Perhaps if you asked on the C# forum[^] someone there may know.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
 |
|
 |
Hi,
Can we disable the particular item in the dropdown combo list box? if it is,Can you please tell me?
Thanks,
Daalu
|
|
|
|
 |
|
 |
While that functionality is not built into the current code it would not be too hard to add. You would have to add a method of keeping track of the enabled states, either a new array member or modify the m_CheckArray member to handle it. Then modify the DrawItem member to draw the disabled items, and modify the OnChar and OnLButtonDown members to properly handle user input. Of course you would also need a get/set enabled method.
Good Luck!
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
 |
|
 |
Is this free to use/modify??
|
|
|
|
 |
|
 |
soonaz wrote: Is this free to use
Yes
soonaz wrote: /modify??
Yes, but it would be nice, though not necessary, if you shared your modifications here with the community at large.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
 |
|
 |
I did put this control on a dialog box for test. When I check/uncheck edit box of an item in the drop-down list box, that item was 'selected' into the edit box of the combo. I want an item to be 'unselected' when I click the 'check box' in the item. Please, Show me the way...
|
|
|
|
 |
|
 |
I noticed that only the last selected OR unselected item is visible in the static portion of the combo box. Refering the screen shoot of your demo app; as a user I would find it quite confusing if the combo box is not dropped down and I un-check the colour green - then the colours black, blue and yellow are still checked but that is not obvious by just looking at your combo box. The only conclusion I can make without drop down the combo box is that of all colours it holds, the colour green is one of the colours not selected.
|
|
|
|
 |
|
 |
You are right, but if you want to see all the selected items in the static portion, then have a look at Magnus's original article, that is what he does. But that model did not fit my application, which does not use colours btw, the colours is just for the demo.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
 |