数学建模社区-数学中国

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

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

& G1 e! M/ R# p* V Answer: ) i2 j9 ^3 T- r8 \3 AYou can create a form with a client edge overriding the CreateParams function and adding the WS_EX_CLIENTEDGE style to Params.ExStyle.

' D1 \( o0 l |+ `" F& J

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

$ J$ Y/ w6 j/ [ u) R. @7 s

private:! g$ s4 A+ `# y4 B void __fastcall CreateParams(TCreateParams &arams);

( F3 W% E6 e. y0 b8 M

Step 2: Code the function.

6 L. Q! r. U; `, q

void __fastcall TForm1::CreateParams(TCreateParams &arams)3 O9 F7 _' q1 P {# V9 N% A; ]# N7 l5 p1 p2 t- Q TForm::CreateParams(Params); // call base class first9 Z0 v! P% J- s4 p6 `4 i5 S Params.ExStyle |= WS_EX_CLIENTEDGE; // then add the style0 x8 O% J% _5 t }

3 |( o$ u4 J: H2 Y

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. ' @6 t" L3 v% v* J R" [






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