|
-
Sep 29th, 2000, 03:21 PM
#1
Thread Starter
Frenzied Member
I want to know if it is possible to make control arrays in VC++ like in VB.
Ex.textbox(1),textbox(2)
And if it is possible - HOW?
-
Sep 29th, 2000, 05:11 PM
#2
Monday Morning Lunatic
Not as such, since C++ doesn't have any mechanisms for doing it (it is non-visual by default). Although, you can do something like this:
Code:
long plTextBoxes[] = {IDC_TEXT1, IDC_TEXT2};
SendMessage(GetDlgItem(hWnd_Main, plTextBoxes[1]), ...);
Although you could always use a vector or list if you needed to dynamically allocate them.
If you're using MFC then there is a (tricky) way to do it, but it needs to be tailored exactly to your project, since there is no generic method.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|