Thread: Edit Box Question

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    47

    Edit Box Question

    Is there anyway to create a Edit Box that will read a int Variable, to appear empty at run time instead of appearing with a 0 ??
    I'm a person with a simple taste...
    I only like the best.

  2. #2
    Registered User Bajanine's Avatar
    Join Date
    Dec 2001
    Location
    The most peaks over 10,000 feet!
    Posts
    396
    Try something like:

    Code:
    SetWindowText ( hdlg, NULL);
    I think that will work!
    Favorite Quote:

    >For that reason someone invented C++.
    BLASPHEMY! Begone from my C board, you foul lover of objects, before the gods of C cast you into the void as punishment for your weakness! There is no penance for saying such things in my presence. You are henceforth excommunicated. Never return to this house, filthy heretic!



  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    47
    Thanks for the help, but I've alredy tried that and it didn't work....
    I tried:
    Code:
    GetDlgItem(IDC_BSIC_B)->SetWindowText(NULL);
    and it didn't work.... well, if there's no easy way to do it, can someone just help me to evaluate if a string value is beteween two Integer values.... something like 0< string <100 ????

    Thanks
    I'm a person with a simple taste...
    I only like the best.

  4. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    26
    <i>evaluate if a string value is beteween two Integer values.... </i>

    I don't get it. Is the string a number??. Just use GetDlgItemInt() to get the integer on the edit box and compare it.

  5. #5
    Registered User
    Join Date
    Jul 2003
    Posts
    59
    Quote Originally Posted by dhrodrigues
    Thanks for the help, but I've alredy tried that and it didn't work....
    Works fine for me. Where did you call the function?

  6. #6
    Registered User
    Join Date
    Aug 2001
    Posts
    47
    My bad.... I tryed that while doing some other stuff at the same time and ended up calling the function in the wrong place.... Thanks erikj for calling that to my attention. It's working now.

    Regarding your question ganonl, yes, the string is a number.... and as I never used GetDlgItemInt , could you supply me some example on how to use GetDlgItemInt .... I belive that it should look like
    Code:
    GetDlgItemInt(IDC_BSIC_B,NULL,TRUE)
    but I still don't know how to evaluate the variable extracted from the IDC_BSIC_B Edit Box... sorry for my basic questions, but this is the only way to learn the subject and stop making mistakes..

    Thanks in advance for your support.
    I'm a person with a simple taste...
    I only like the best.

  7. #7
    Registered User
    Join Date
    Aug 2001
    Posts
    47
    Nevermind ganonl, I manage to figure that out...

    Code:
    if ((GetDlgItemInt(IDC_BSIC_A, NULL, FALSE)<=10) || (GetDlgItemInt(IDC_BSIC_A, NULL, FALSE) >= 70))
    Thanks for the Idea ganonl, i belive I'll prefer to use this instead of changing my project to receive ints instead of strings.

    thanks once again for pointing me the right direction.
    I'm a person with a simple taste...
    I only like the best.

  8. #8
    Registered User
    Join Date
    Aug 2003
    Posts
    26
    Your getdlgitemint only has 3 parameters. The one I use has 4.

    Code:
    UINT GetDlgItemInt(
    
        HWND  hDlg,	// handle to dialog box
        int  nIDDlgItem,	// control identifier
        BOOL*  lpTranslated,	// points to variable to receive success/failure indicator
        BOOL  bSigned 	// specifies whether value is signed or unsigned
       );

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. edit box
    By beene in forum Windows Programming
    Replies: 3
    Last Post: 11-11-2006, 04:40 AM
  2. WS_HSCROLL in ES_READONLY edit box error
    By Homunculus in forum Windows Programming
    Replies: 4
    Last Post: 02-13-2006, 08:46 AM
  3. Multiline Edit Box Parser
    By The Brain in forum Windows Programming
    Replies: 6
    Last Post: 11-01-2005, 07:15 PM
  4. setting fixed floats in edit box
    By WaterNut in forum Windows Programming
    Replies: 4
    Last Post: 08-13-2004, 09:13 AM
  5. How do i make a "new line" with in an edit box?
    By Clyde in forum Windows Programming
    Replies: 3
    Last Post: 05-18-2002, 01:35 PM