Click here to Skip to main content
15,921,622 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralNeed help with CComboBox control. Pin
doubleplay0923-Nov-02 4:58
doubleplay0923-Nov-02 4:58 
Generaltoo many items in treeview Pin
Peter Molnar23-Nov-02 4:33
Peter Molnar23-Nov-02 4:33 
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 
VanHlebar wrote:
Is this similar to how it work?

Yes, that may not be the exact syntax, but that is how you would set up your array of Edit controls.

VanHlebar wrote:
How do I know which array element has been clicked on or text entered etc?

There is no mechanism in C++ that allows you to handle the controls based on an index. However you can set this up yourself. First off, you can set the same handler for each of the controls. If you need to know the index of hte control in your array, you can do one of two things:

1) Search for the current object in your array, and when you find the object you will know the index.

2) Is a little bit more complicated, but you can use SetWindowLong with the GWL_USERDATA flag, and set the index there. That way whenever your window needs to know which index it possesses you can simpy query GetWindowLong.

3) And I just thought of a third, you can create a derived class from CEdit that has a place where you can store the index ID that you want to give your control.

Good Luck



Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!

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 
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 

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.