数学建模社区-数学中国

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

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

) e9 C, N2 U D) @Answer: ) d* o$ [7 K- d+ H. aYou can create a form with a client edge overriding the CreateParams function and adding the WS_EX_CLIENTEDGE style to Params.ExStyle.

" O' s! Z$ _! m N: f

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

% f X* s% s7 A' H1 L

private: a6 [- v* F# I! B( R void __fastcall CreateParams(TCreateParams &arams);

* m b; e2 }5 f# ?4 [" |0 n; ~+ b

Step 2: Code the function.

. ~: W6 z, p3 z# a4 }

void __fastcall TForm1::CreateParams(TCreateParams &arams)8 |3 W# U, f P {4 K& b1 h/ V2 h( a TForm::CreateParams(Params); // call base class first 1 K7 b( R* c- E- ^3 V5 i3 q$ q Params.ExStyle |= WS_EX_CLIENTEDGE; // then add the style 3 G, Z" \$ i6 p" B' }5 } }

0 B0 t' R9 ]$ ]1 z

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. 9 q% a+ F8 f, }- i% i0 F






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