Results 1 to 4 of 4

Thread: VB-like Control array in C++ ??

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151

    VB-like Control array in C++ ??

    I have a VB application which adds Text Boxes to (or removes them from) a Form at run time, depending on how many I need at a particular time.

    Can this be done in C++ ?
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    It ceratinly can. You can create, delete and modify any window in your program at any time, and a control is just a specific kind of window.

    If you're interested in doing it with MFC rather than the WIndows API way, I couldn't tell you for sure, but I am pretty certain it won't be difficult.
    Harry.

    "From one thing, know ten thousand things."

  3. #3
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    something like this...
    PHP Code:
    int numBoxes 5//or any other number
    HWND box[numBoxes];
    for(
    int i=1i<=numBoxesi++)  {
         
    CreateWindow(....);

    and you can just make another variable to make sure the text boxes (edit boxes) don't overlap each other

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    except that
    HWND box[numBoxes]; will create an error...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width