Adding static control to childvew
-
Hi all, Instead of opening a Static control(which is subclassed) in a Dialog box,i want to open it in the Mainframe window. But when i create a variable of the class(subclassed) in the MainFrame(derived from CFrameWnd)and call the Create(with all right parameters) function the control is not visible in the Mainframe window :(( i'm not able to figure out the reason :zzz: y itz not showing up.It'll be really great if someone can help me out in this. Thanks in advance, rajeev
-
Hi all, Instead of opening a Static control(which is subclassed) in a Dialog box,i want to open it in the Mainframe window. But when i create a variable of the class(subclassed) in the MainFrame(derived from CFrameWnd)and call the Create(with all right parameters) function the control is not visible in the Mainframe window :(( i'm not able to figure out the reason :zzz: y itz not showing up.It'll be really great if someone can help me out in this. Thanks in advance, rajeev
-
When you create the control with
Create
, be sure theWS_VISIBLE
window style is specified, for instance:myStatic.Create("Test", WS_BORDER | WS_VISIBLE, CRect(30,30,100,100), this, 12345);
-
well all those properties have been set properly but still i'm not able to get it right.. -- modified at 9:55 Friday 9th June, 2006
Is your variable for static control defined as a class member, or as a local variable in
CMainFrame::OnCreate
? In order to work, you have to have a line likeCMyStatic mMyStatic;
within frame class declaration (in *.h file), and a line likemMyStatic.Create(...)
somewhere at the end ofCMainFrame::OnCreate
function. Where are you creating the control? -
well all those properties have been set properly but still i'm not able to get it right.. -- modified at 9:55 Friday 9th June, 2006
What type of project are you using ? SDI or MDI ? If it's SDI, I think you have to create it on the view, and not on the mainframe.
Cédric Moonen Software developer
Charting control -
What type of project are you using ? SDI or MDI ? If it's SDI, I think you have to create it on the view, and not on the mainframe.
Cédric Moonen Software developer
Charting control -
its an SDI application.... the code i've used is CLed m_led; ///declared in mainframe.h m_led.Create(...);// in the OnCretae of mainframe.cpp here CLed is a class derived from CStatic which gives some special features to a static control...
Did you read and tried the solution that people gave you ? I'm almost sure that Viorel got the point. Did you tried it ?
Cédric Moonen Software developer
Charting control