Thread: Editboxes and their text, HELP!

  1. #1
    Registered User
    Join Date
    Sep 2001

    Post Editboxes and their text, HELP!


    Okay I have a dialog box, which I am using as my main window, and it has a disabled editbox on it. (Which was recoloured white to seem like a normal editbox but without allowing the users to click/edit/change anything in it.) Now my problem is, I use the following code:

    char string[] = "Testing";
    SetDlgItemText(hWndDialog, Edit_Files, string);

    But no text appears. Any help would be great. (I've even tried to place the text in the window when the window isn't disabled and still nothing happens.)
    Use the code Luke.

  2. #2
    Registered User lobo's Avatar
    Join Date
    Oct 2001
    maybe this is stupid, but what if you used

    SetWindowText(GetDlgItem(hwndDialog, <ID_OF_THAT_EDITBOX>), string);

    i think code like this works normally, but i didn't try it in such an application (dialog window only). Try it out...

  3. #3
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    If you do what I suggested in your last thread (set the edit box to read only)and if you are concerned that the user can still click on the edit box and affect the caret position, then trap the messages to the edit box, and if it gets one send the focus elsewhere. If this still affects the caret position then you can use GetCaretPos() and SetCaretPos();

Popular pages Recent additions subscribe to a feed