数学建模社区-数学中国

标题: Create a form with a client edge [打印本页]

作者: 韩冰    时间: 2005-1-26 01:39
标题: Create a form with a client edge

& y4 Y$ `% w4 Z( A$ F9 x& IAnswer: ) z" Z2 ~. ~4 @- n6 O% GYou can create a form with a client edge overriding the CreateParams function and adding the WS_EX_CLIENTEDGE style to Params.ExStyle.

0 ?! d- G0 {) s( b) j" b% y8 K. D& ^

Step 1: Add the CreateParams prototype to the form class.

6 ?8 @8 M; r4 L

private: 2 m2 T0 Q$ R: C1 N+ `3 s0 { void __fastcall CreateParams(TCreateParams &arams);

* b$ p( [/ q, i8 c

Step 2: Code the function.

" Z) n, M9 q. {6 {% m- v/ f

void __fastcall TForm1::CreateParams(TCreateParams &arams)* W( \: C4 m( X5 n) k+ z4 l { 1 z% ?: L+ a9 O* g& h/ A TForm::CreateParams(Params); // call base class first4 \, [0 ? u9 e! f4 a Params.ExStyle |= WS_EX_CLIENTEDGE; // then add the style 8 c: t1 K) t. ]. e! [ }

& t3 Y+ e3 ]! H8 R

If you would rather not bother with CreateParams, you can achieve identical results by placing a panel on your form. Set the Aligment property of the panel to alClient, set both BevelInner and BevelOuter to bvNone, and set the panel's BorderStyle property to bsSingle. 2 h$ E6 c) H" z) z5 }, O7 _






欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) Powered by Discuz! X2.5