Thread: How do I make a text box??

  1. #1
    BubbleMan
    Guest

    Question How do I make a text box??

    How would I make a text box for the user to type in??

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Use an edit box control.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227

    here yah go

    This is how you do it on a normal window:
    Code:
              hwndEdit = CreateWindow ("edit", NULL,
                             WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL |
                                       WS_BORDER | ES_LEFT | ES_MULTILINE |
                                       ES_AUTOHSCROLL | ES_AUTOVSCROLL,
                             0, 0, 0, 0, hwnd, (HMENU) ID_VIEW,
    						 hInst, NULL);

  4. #4
    BubbleMan
    Guest

    Question Didn't work...(errors)

    It says hwndEdit undeclared and ID_VIEW undeclared!!

  5. #5
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227

    sigh...

    try adding

    hwnd hwndEdit;

    and

    #define ID_VIEW 1

    into your code.

  6. #6
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227

    ack!!

    Ok, see where in the code it says

    0,0,0,0 all in a row like that? Change it to
    0,0,200,200 if you actually want to SEE the editbox

  7. #7
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Cute mistake though...

    My first window I accidentally created it out of range of the screen, so for an hour I just kept clicking the Taskbar Icon that was *swearing* the window was active and visible... till of course I noticed it peaking from the edge of the screen...

    And thanks for the code Ken, I was actually about to post the same question(Sunlight confuses me!! --Argh...)
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  8. #8
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    yeah, I hate his windows tut's for some odd reason.

  9. #9
    aurė entuluva! mithrandir's Avatar
    Join Date
    Aug 2001
    Posts
    1,209
    I tried Sunlight's tutorials once...very confusing to say the least!

  10. #10
    Registered User minime6696's Avatar
    Join Date
    Aug 2001
    Posts
    267

    Sunlight... :p

    Sunlight was a bit full of himself, not a very good teacher, never gave any answers, just "See my tuts" "Look @ the FAQ". We could ourselves to do that, when we post something we want REAL and HUMAN help .

    SPH

  11. #11
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Sunlight answered many questions and helped a lot of people here, and elsewhere. If you don't like his tutorials, there are many others - search google, you'll find hundreds. If you don't like his style, don't read his replies, (your loss of course).
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  12. #12
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227

    eh..

    Never said I didn't like him, I thought he was great, and a very intelligent person, all I said was that his tutorials confused me...that's what drove me to pick up petzold's.

  13. #13
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    My post was aimed more at Sean's mail.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Obtaining a value from a text box
    By thetinman in forum Windows Programming
    Replies: 1
    Last Post: 11-23-2006, 05:50 PM
  2. Converting a text box value into a character array?
    By n00bguy in forum Windows Programming
    Replies: 3
    Last Post: 07-29-2006, 08:08 PM
  3. Adding text to a disabled edit box
    By osal in forum Windows Programming
    Replies: 1
    Last Post: 06-16-2004, 01:23 PM
  4. New Theme
    By XSquared in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 04-01-2004, 08:00 PM
  5. Outputting String arrays in windows
    By Xterria in forum Game Programming
    Replies: 11
    Last Post: 11-13-2001, 07:35 PM