Click here to Skip to main content
15,920,053 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: too many items in treeview Pin
pnpfriend23-Nov-02 9:23
pnpfriend23-Nov-02 9:23 
GeneralRe: too many items in treeview Pin
Peter Molnar23-Nov-02 12:47
Peter Molnar23-Nov-02 12:47 
QuestionHow/Can I create an array of controls? Pin
VanHlebar23-Nov-02 3:45
VanHlebar23-Nov-02 3:45 
AnswerRe: How/Can I create an array of controls? Pin
Peter Molnar23-Nov-02 4:42
Peter Molnar23-Nov-02 4:42 
GeneralRe: How/Can I create an array of controls? Pin
VanHlebar23-Nov-02 6:11
VanHlebar23-Nov-02 6:11 
GeneralRe: How/Can I create an array of controls? Pin
Paul M Watt23-Nov-02 6:44
mentorPaul M Watt23-Nov-02 6:44 
GeneralRe: How/Can I create an array of controls? Pin
georgiek5023-Nov-02 6:44
georgiek5023-Nov-02 6:44 
GeneralRe: How/Can I create an array of controls? Pin
Peter Molnar23-Nov-02 7:02
Peter Molnar23-Nov-02 7:02 
//CButton m_btnFirst,m_btnSecond, ...; 
//CRect rect1,rect2...; the button's coordinates
//CWnd* pWnd; pointer to the parent

m_btnFirst.Create("Button1", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, rect1, pWnd, IDC_BUTTON_FIRST);
m_btnSecond.Create("Button2", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, rect2, pWnd, IDC_BUTTON_FIRST + 1);
m_btnThird.Create("Button3", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, rect3, pWnd, IDC_BUTTON_FIRST + 2);
...

Message map:
BEGIN_MESSAGE_MAP(CYourDlg, CDialog)
	ON_CONTROL_RANGE(BN_CLICKED, IDC_BUTTON_FIRST, IDC_BUTTON_FIRST + nNumberOfButtons,OnRange)
END_MESSAGE_MAP()


OnRange(UINT nID) is the dialogs function that gets called when any of the buttons is pressed. the Button's ID will be in the nID variable.
Important: make sure your IDC_BUTTON_FIRST is defined in resource.h with a unique value, and that there are no other controls in the IDC_BUTTON_FIRST + nNumberOFButtons range.


Bunburry
Generalms word automation Pin
pnpfriend23-Nov-02 3:28
pnpfriend23-Nov-02 3:28 
QuestionHow to control a threads CPU utilization? Pin
mediamaster4023-Nov-02 3:16
mediamaster4023-Nov-02 3:16 
AnswerRe: How to control a threads CPU utilization? Pin
mediamaster4025-Nov-02 3:11
mediamaster4025-Nov-02 3:11 
GeneralCListCtrl - Selection Problem Pin
#realJSOP23-Nov-02 0:54
professional#realJSOP23-Nov-02 0:54 
GeneralRe: CListCtrl - Selection Problem Pin
Gary R. Wheeler23-Nov-02 1:50
Gary R. Wheeler23-Nov-02 1:50 
GeneralRe: CListCtrl - Selection Problem Pin
#realJSOP23-Nov-02 3:22
professional#realJSOP23-Nov-02 3:22 
GeneralRe: CListCtrl - Selection Problem Pin
Jean-Marc Molina3-Oct-03 1:12
Jean-Marc Molina3-Oct-03 1:12 
GeneralDialogues en MFC Pin
bumper23-Nov-02 0:54
bumper23-Nov-02 0:54 
GeneralRe: Dialogues en MFC Pin
Gary R. Wheeler23-Nov-02 2:00
Gary R. Wheeler23-Nov-02 2:00 
GeneralRe: Dialogues en MFC Pin
bumper23-Nov-02 2:40
bumper23-Nov-02 2:40 
GeneralRe: Dialogues en MFC Pin
Maximilien24-Nov-02 16:19
Maximilien24-Nov-02 16:19 
GeneralRe: Dialogues en MFC Pin
bumper25-Nov-02 11:08
bumper25-Nov-02 11:08 
GeneralPreserving clipboard content Pin
mariuszpopiolek22-Nov-02 23:49
mariuszpopiolek22-Nov-02 23:49 
GeneralRe: Preserving clipboard content Pin
Gary R. Wheeler23-Nov-02 2:11
Gary R. Wheeler23-Nov-02 2:11 
GeneralRe: Preserving clipboard content Pin
mariuszpopiolek23-Nov-02 2:22
mariuszpopiolek23-Nov-02 2:22 
GeneralRe: Preserving clipboard content Pin
Paul M Watt23-Nov-02 6:57
mentorPaul M Watt23-Nov-02 6:57 
GeneralRe: Preserving clipboard content Pin
mariuszpopiolek23-Nov-02 13:22
mariuszpopiolek23-Nov-02 13:22 

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.