Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Very Simply 'EDIT' Question (No MFC)

Status
Not open for further replies.

AlienWar

Programmer
Dec 21, 2001
3
DK
Hi,

I have made an EDIT textbox, and now i want to put some text in it! I have used this code:

SendMessage(EDIT, WM_SETTEXT, 0, (LPARAM)(LPCTSTR)"I wnat to make more then one line of text \nbut it wont make more then one line!");

when I created the EDIT box i have used the ES_READONLY and ES_MULTILINE.... Why won't the EDIT box not make more then one line??? what are I'm doing wrong???

Thanks
..:::Ali£nWar:::..
 
If that doesn't work, there's an example in MSDN of creating an array of strings and adding all of them in one call, so you could probably do something like this:

Code:
CHAR lpszTrouble[] = "When in the Course of human Events " 
                     "it becomes necessary for one People " 
                     "to dissolve the Political Bands which " 
                     "have connected them with another, and " 
                     "to assume among the Powers of the " 
                     "Earth, the separate and equal Station " 
                     "to which the Laws of Nature and of " 
                     "Nature's God entitle them, a decent " 
                     "Respect to the Opinions of Mankind " 
                     "requires that they should declare the " 
                     "causes which impel them to the " 
                     "Separation. "; 
 
switch (message) 
{ 
    case WM_CREATE: 
        hwndEdit = CreateWindow( 
            "EDIT",     // predefined class 
            NULL,       // no window title 
            WS_CHILD | WS_VISIBLE | WS_VSCROLL | 
                ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL, 
                0, 0, 0, 0, // set size in WM_SIZE message 
                hwnd,       // parent window 
                (HMENU) ID_EDITCHILD, // edit control ID 
                (HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE), 
                NULL);  // pointer not needed 
 
         // Add text to the window. 
 
         SendMessage(hwndEdit, WM_SETTEXT, 0, 
            (LPARAM) lpszTrouble); 

         return 0;
 
It still won't make a new line in the EDIT box !!!
I won't it remain the "layout" it has, even though you resize the window !!! like this:

This is the Text!
Even though I
Resize the window
the text inside
the EDIT box will
still have the
same 'layout'

Plz Help Me!
-=<GOOOD>=-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top