Check box control
-
I want to make my own check box control. Where can i find source code for standard check box (CButton)? Or at least to know how to draw standard check box?
SLiDeR wrote: Where can i find source code for standard check box (CButton)? Have you looked in the \Program Files\Microsoft Visual Studio\VC98\MFC folder? There's a SRC and an INCLUDE folder that have the declaration and definition of the
CButton
class.
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?
-
I want to make my own check box control. Where can i find source code for standard check box (CButton)? Or at least to know how to draw standard check box?
Ok the way i see it there are two ways you can go about creating a checkbox control. 1. You can use the the visual c++'s resource editor on a dialog box. If you choose to do so you will need see a tutorial on visual c++. this can be found on http://msdn.microsoft.com 2. The other way is to use mfc to do it heres a sample... declare a checkbox control (actually its a special type of Button control) CEdit myCheckBox; go ahead and initialize it myCheckBox.Create(LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); now the dwStyle above must have at least the following flag "BS_AUTOCHECKBOX" heres an example. myCheckBox.Create("Search Any Word", WS_VISIBLE | BS_AUTOCHECKBOX, CRect(365,0,470,30), this, IDC_CHECK1) IDC_CHECK1 is the dialog control ID. Hope this makes sence. void signature(){ cout<<"Sobbayi Interactive"<
-
Ok the way i see it there are two ways you can go about creating a checkbox control. 1. You can use the the visual c++'s resource editor on a dialog box. If you choose to do so you will need see a tutorial on visual c++. this can be found on http://msdn.microsoft.com 2. The other way is to use mfc to do it heres a sample... declare a checkbox control (actually its a special type of Button control) CEdit myCheckBox; go ahead and initialize it myCheckBox.Create(LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); now the dwStyle above must have at least the following flag "BS_AUTOCHECKBOX" heres an example. myCheckBox.Create("Search Any Word", WS_VISIBLE | BS_AUTOCHECKBOX, CRect(365,0,470,30), this, IDC_CHECK1) IDC_CHECK1 is the dialog control ID. Hope this makes sence. void signature(){ cout<<"Sobbayi Interactive"<
-
SLiDeR wrote: Where can i find source code for standard check box (CButton)? Have you looked in the \Program Files\Microsoft Visual Studio\VC98\MFC folder? There's a SRC and an INCLUDE folder that have the declaration and definition of the
CButton
class.
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?
-
I know about MFC sources. There is CButton source code. But CButton simply uses CreateWindow() function to create check box. But i need source code for DrawItem() function.
SLiDeR wrote: I know about MFC sources. Then you also know that you are expected to provide your own
CButton::DrawItem()
function as the base-class implementation does nothing except fire an assertion. SLiDeR wrote: But i need source code for DrawItem() function. In other words, there is no source code available.
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?