[Windows] Dialog boxes

Started by
0 comments, last by the darkening 22 years, 9 months ago
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
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  

This topic is closed to new replies.

Advertisement