Edit Box Idiocy!!!!!!! HELP!!!!
I am trying to write a text based RPG deal as a development stage to a full graphics based RPG. I am programming this in VC++ 6.0 because it''s all text. I use a read only multiline text box to display descriptions and such. When loading the value string of the edit box, I need new lines to separate sentances. But every time I append a ''\n'' to the CString in the box, it somes out as a character and not a newline...Does anyone know how to put a new line into an edit box? I''m not really a VC++ pro, more of a novice, so any feedback would be appreciated.
P.S. While I''m on it, does anyone know how to change text color in an edit box?
"Victims...aren't we all?" -Brandon Lee, the Crow
Codeguru has some excellent edit control stuff here
Several of the controls involve coloring the text but I thought I''d give you the entire page as there''s some other cool edit control related stuff there as well.
-fel
Several of the controls involve coloring the text but I thought I''d give you the entire page as there''s some other cool edit control related stuff there as well.
-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
Ok...the ''\r\n'' worked to get new lines. But now I find that I am getting an unexpected result. The edit box scroll bar automaticaly moves itself back up to the top each new entry. Is there a way to get the scroll bar to stay at the bottom of the edit box?
"Victims...aren't we all?" -Brandon Lee, the Crow
Off hand the only thing I can think of is to do something like this every time you add text...
int nMin,nMax;
m_Edit1.GetScrollRange(SB_VERT, &nMin, &nMax);
m_Edit1.SetScrollPos(SB_VERT, nMax, TRUE);
Assuming you have a CEdit mapped to the control. Otherwise there are probably Win32 functions of the same name. I don''t know if this the the best/easiest way, but it should work.
int nMin,nMax;
m_Edit1.GetScrollRange(SB_VERT, &nMin, &nMax);
m_Edit1.SetScrollPos(SB_VERT, nMax, TRUE);
Assuming you have a CEdit mapped to the control. Otherwise there are probably Win32 functions of the same name. I don''t know if this the the best/easiest way, but it should work.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement