Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

the darkening

[Windows] Dialog boxes

This topic is 6268 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, how do I put a text in an edit field inside a dialog box without a selection? If I try SetDlgItemText, the text is always highlighted. And do I have to use "13, 10" for a new line (I''d like to use the normal "\n")? Thanks in advance Darkening

Share this post


Link to post
Share on other sites
Advertisement
First off, are you creating the window by hand, or using the resource editor (I assume you are using VC++).

Here's my WM_CREATE code, and it doesn't highlight the text I put in (also puts multiline).

  
case WM_CREATE:
hDlg = CreateDialog(hInst,MAKEINTRESOURCE(IDD_MYDIALOG),hWnd,(DLGPROC)DlgWndProc);
ShowWindow(hDlg,SW_SHOW);
SetDlgItemText(hDlg,IDC_EDIT,"Hello World\r\nJust testing");
[\SOURCE]

Yes, because of Windows, you have to use \r\n to make a newline.

Edited by - Nytegard on June 21, 2001 8:56:01 PM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!