Click here to Skip to main content
16,005,080 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Which Message to handle for Only ALT key Pin
Vikash Dubey22-Jun-05 18:47
Vikash Dubey22-Jun-05 18:47 
GeneralRe: Which Message to handle for Only ALT key Pin
Nilesh K.22-Jun-05 19:04
Nilesh K.22-Jun-05 19:04 
GeneralRe: Which Message to handle for Only ALT key Pin
David Crow23-Jun-05 3:10
David Crow23-Jun-05 3:10 
GeneralWindoes Services Pin
Laji5921-Jun-05 22:12
Laji5921-Jun-05 22:12 
GeneralRe: Windoes Services Pin
ThatsAlok21-Jun-05 22:17
ThatsAlok21-Jun-05 22:17 
GeneralAPI Imap Pin
Member 34468121-Jun-05 22:09
Member 34468121-Jun-05 22:09 
GeneralLots of check boxes... Pin
mcsherry21-Jun-05 22:02
mcsherry21-Jun-05 22:02 
GeneralRe: Lots of check boxes... Pin
Cedric Moonen21-Jun-05 22:24
Cedric Moonen21-Jun-05 22:24 
I would do it like that: you keep an array of CButton (I think this is the class that handle check boxes messages), then in OnInitDialog, I will instantiate this array and create the check boxes:

BOOL CyourDlg::OnInitDialog()<br />
{<br />
   m_pCheckBoxesArray = new CButton[m_ChckBoxCount];<br />
   for (int i=0;i<ChckBoxCount;i++)<br />
       m_pCheckBoxesArray[i].Create(......);<br />
}


In the Create function, you will need to pass the Id of the control and its position. For the Id, edit the ressource file and use consecutive Id's so you can just do something like that:

for (int i=0;i<ChckBoxCount;i++)<br />
       m_pCheckBoxesArray[i].Create(.., IDC_FIRSTCHCKBOX+i ,....);<br />


In the ressource file, you can do something like that:
#define IDC_FIRSTCHCKBOX    10000<br />
#define IDC_LASTCHCKBOX     10070


Then you can use the ON_CONTROL_RANGE macro instead of ON_COMMAND to map the notification messages of all your check boxes (take a look in the MSDN).

Hope this helps
GeneralRe: Lots of check boxes... Pin
mcsherry21-Jun-05 22:32
mcsherry21-Jun-05 22:32 
GeneralRe: Lots of check boxes... Pin
liquid_22-Jun-05 7:12
liquid_22-Jun-05 7:12 
GeneralRe: Lots of check boxes... Pin
Jose Lamas Rios22-Jun-05 16:17
Jose Lamas Rios22-Jun-05 16:17 
GeneralCOM-port mistery Pin
tomek1821-Jun-05 21:44
tomek1821-Jun-05 21:44 
GeneralRe: COM-port mistery Pin
Cedric Moonen21-Jun-05 21:51
Cedric Moonen21-Jun-05 21:51 
GeneralRe: COM-port mistery Pin
tomek1821-Jun-05 22:00
tomek1821-Jun-05 22:00 
QuestionHow to change the CListCtrl control's Header(column) background color Pin
Girish60121-Jun-05 20:09
Girish60121-Jun-05 20:09 
AnswerRe: How to change the CListCtrl control's Header(column) background color Pin
DiWa21-Jun-05 21:26
DiWa21-Jun-05 21:26 
Generalviews in dialog Pin
asdeshmukh21-Jun-05 19:35
asdeshmukh21-Jun-05 19:35 
Generalincluding custom font in app Pin
maruku21-Jun-05 19:35
maruku21-Jun-05 19:35 
GeneralRe: including custom font in app Pin
Chris Losinger22-Jun-05 3:24
professionalChris Losinger22-Jun-05 3:24 
GeneralBinding socket not working in win98 Pin
dasnov21-Jun-05 19:22
dasnov21-Jun-05 19:22 
GeneralWindows Services Pin
21-Jun-05 18:39
suss21-Jun-05 18:39 
GeneralRe: Windows Services Pin
ThatsAlok21-Jun-05 18:51
ThatsAlok21-Jun-05 18:51 
Generalclient-server Pin
ask_you21-Jun-05 18:33
ask_you21-Jun-05 18:33 
GeneralRe: client-server Pin
munawar196821-Jun-05 19:10
munawar196821-Jun-05 19:10 
GeneralRe: client-server Pin
ask_you21-Jun-05 19:19
ask_you21-Jun-05 19:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.