|
9 d* a0 ]/ n t1 HAnswer:
& x" |/ N: e1 iYou can create a form with a client edge overriding the CreateParams function and adding the WS_EX_CLIENTEDGE style to Params.ExStyle. . x' I: q; P6 {% d' t, b
Step 1: Add the CreateParams prototype to the form class.
5 i5 F! ?7 a: X4 {* o$ E; P1 { private:
; Y% ~2 n0 i/ |0 k: X, w- w void __fastcall CreateParams(TCreateParams & arams);
5 U. B4 b2 q& r5 S" uStep 2: Code the function.
. G0 Y$ C9 a$ I# B void __fastcall TForm1::CreateParams(TCreateParams & arams)
7 ]: @. J7 l- ^4 |4 s4 _1 i {
1 `3 l: ]3 U0 B) P3 { TForm::CreateParams(Params); // call base class first
$ h) C% [% L6 N% t1 f Params.ExStyle |= WS_EX_CLIENTEDGE; // then add the style- {+ K- d# J/ R: r! J; `$ U
} 4 p( N5 u& m( y/ R6 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.
; S N8 N. }2 f% d8 W: k6 W |