#### Archived

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

# [Windows] Dialog boxes

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

## 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 on other sites
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