数学建模社区-数学中国

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

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

* T* ]+ Z# U4 F- d Answer: 2 ~1 N1 s2 T4 c' W" b% Y6 m You can create a form with a client edge overriding the CreateParams function and adding the WS_EX_CLIENTEDGE style to Params.ExStyle.

5 Q5 E* c/ K7 }" q, a( N0 d

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

' l6 j: \" Z8 e$ l8 N; G \

private:: |- \2 ]& n& @- P void __fastcall CreateParams(TCreateParams &arams);

! b. }" O5 t2 V

Step 2: Code the function.

; A o! |8 C( g- v; e. n

void __fastcall TForm1::CreateParams(TCreateParams &arams) ! T2 E1 H9 F# \. z# U4 D1 X { ( m& K5 V3 j& s; P7 [0 q _ TForm::CreateParams(Params); // call base class first4 @$ ^- W: ~& |( W/ z Params.ExStyle |= WS_EX_CLIENTEDGE; // then add the style 5 i' }2 f/ t- h/ k/ e, g9 Q- o% q; r: [ }

* s% _& ?; G/ w4 N+ L

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. & o0 p' a% [# P6 {






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