When I try to do a SetWindowText to set the text inside the box it
doesn't work.
My code works when I do a Create....
m_local_edit_box[i].Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP |
ES_LEFT | ES_READONLY | WS_BORDER, rect_string, this,
m_ID++);
SetWindowText works fine with this line of code, but the box isn't
displayed as I'd like it to be.
Anyone got any ideas?
p.s. Thanks for the previous help. It worked great!
Oops! You're creating a window with a NULL title--which may be okay--
and a NULL class name--which is definitely not. In other words, you're
not creating an editbox at all; you're just creating a generic window.
>When I try to do a SetWindowText to set the text inside the box it
>doesn't work.
That's because there's nothing to draw the window's contents, since
that would normally be done by the class code, and this window has no
class code associated with it (since the class name is NULL).
>My code works when I do a Create....
>m_local_edit_box[i].Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP |
> ES_LEFT | ES_READONLY | WS_BORDER, rect_string, this,
>m_ID++);
>SetWindowText works fine with this line of code, but the box isn't
>displayed as I'd like it to be.
This works because you're now calling CEditBox::Create, which sets the
class name and other needed info appropriately. The CEditBox class doesn't
have a CreateEx method; so you're actually calling CWnd::CreateEx, which
doesn't know which class name to use unless you tell it.
>Anyone got any ideas?
Two possibilities:
*Use your CreateEx call, but use "EDIT" for the class name, rather than
NULL.
*Use the Create call, and call ModifyStyleEx(0, WS_EX_CLIENTEDGE,
SWP_FRAMECHANGED) immediately afterwards.
--
\o\ If you're interested in books and stories with transformation themes, \o\
/o/ please have a look at <URL:http://www.halcyon.com/phaedrus>. Thanks! /o/
\o\ FC1.21:FC(W/C)p6arw A- C->++ D>++ H+ M>+ P R T++++ W** Z+ Sm RLCT \o\
/o/ a cmn++++$ d e++ f+++ h- i++wf p-- sm# /o/