Advertisement

Having a little problem with adding in word wrap

Started by February 06, 2003 06:39 PM
2 comments, last by Klindarin 21 years, 11 months ago
I would like to add word wrap to the bottom code but as I was going through a tutorial and writing a little of my own and taking some excerpts from the tutorial im not 100% sure how or where to add word wrap in. The text just disappears after it exceeds the length of the output box. Is there a WS_ or LBS_ thing I could put within in the Output box window that would put word wrap? case EN_UPDATE: // Get the text from the edit box GetWindowText(hEB_InputField,szMessage,256); // Check if they pressed enter if ( szMessage[strlen(szMessage)-1] == 10 ) { // Get rid of trailing garbage szMessage[strlen(szMessage)-2] = ''\0''; GetWindowText(hEB_InputName,szMyName,32); sprintf(szCompMessage,"<%s> %s", szMyName, szMessage); // clear input field SetWindowText(hEB_InputField,""); // // Send a chat packet to the server // ChatMsg.dwSize = sizeof(PacketChat); ChatMsg.dwType = PACKET_TYPE_CHAT; strcpy(ChatMsg.szText,szCompMessage); // Convert the packet to a void stream packet = (VOID*)&ChatMsg // Send the chat packet hReturn = hrSendClientMessage(PACKET_TYPE_CHAT,packet); } } break; } Another part of the code I am adding in is a 2nd box that updates when a User connects. The server accepts new people logging in by assigning "Slots" to them Slot0 = me Slot1 = Guest2 Slot2 = Bill etc.. Would it be easier for me to just upload the Slot settings into that window to show the users connected or is there an easier where or more efficient? Any help would be appreciated.
MattPresident IGW Interactivewww.igworld.com (Phase 1 in Dev)
If you are using an Edit Box you can set the style ES_MULTILINE to get word wrap.

If you are using a List Box MSDN has this note:

"LBS_NOINTEGRALHEIGHT The size of the list box is exactly the size specified by the application when it created the list box. Usually, Windows sizes a list box so that the list box does not display partial items."

So make sure you do not have this style set. If this fails to work you have to make the control wide enough to hold your entire string OR make it owner draw and implement word wrap yourself.

Good Luck.
Advertisement
If you are using an Edit Box you can set the style ES_MULTILINE to get word wrap.

If you are using a List Box MSDN has this note:

"LBS_NOINTEGRALHEIGHT The size of the list box is exactly the size specified by the application when it created the list box. Usually, Windows sizes a list box so that the list box does not display partial items."

So make sure you do not have this style set. If this fails to work you have to make the control wide enough to hold your entire string OR make it owner draw and implement word wrap yourself.

Good Luck.
Yeah Im using a List box its what the tutorial was based on.

I was wondering what would be easier to try to manuelly write in word wrap or try to switch the Output box as an Edit Box?
MattPresident IGW Interactivewww.igworld.com (Phase 1 in Dev)

This topic is closed to new replies.

Advertisement