|
% S; U5 O2 q6 y7 t& h# y2 k. K: eAnswer:
. t* j2 a% }5 c4 u+ C- ?& DYou can create a form with a client edge overriding the CreateParams function and adding the WS_EX_CLIENTEDGE style to Params.ExStyle.
* u6 W! S4 D! M. ]! d0 gStep 1: Add the CreateParams prototype to the form class. ( }, S" u1 k$ ~9 w3 U
private:( ~1 |( q( b! g3 `9 E% a
void __fastcall CreateParams(TCreateParams & arams); ' L& R+ I3 @3 c9 Y* p
Step 2: Code the function.
& s% c3 J4 o' G5 J! ?$ g void __fastcall TForm1::CreateParams(TCreateParams & arams)' H- a8 I7 g4 ], B3 M8 K
{5 j4 s: K9 k& O" E6 g. J9 M
TForm::CreateParams(Params); // call base class first
0 ]" k* k" J5 V Params.ExStyle |= WS_EX_CLIENTEDGE; // then add the style7 i1 V4 c/ `0 g' l6 w% D* L8 \0 H9 a
} % ^' h6 v4 j# o
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 c2 E M2 \' u! D+ _$ G* T- |
|