|
4 T* D6 G) Y: ?Answer: - ^3 M1 F" K# Y+ u+ F
You can create a form with a client edge overriding the CreateParams function and adding the WS_EX_CLIENTEDGE style to Params.ExStyle.
. w5 B* q1 l. D; ]Step 1: Add the CreateParams prototype to the form class.
0 X- W- ~: F- ]. g private:1 G: a8 l* Z. ^5 K' e
void __fastcall CreateParams(TCreateParams & arams); 9 u6 j3 L, x4 v. f* F
Step 2: Code the function. 1 Q/ ^) T# w$ O; }* ~7 k
void __fastcall TForm1::CreateParams(TCreateParams & arams)
$ W9 e: R& ^! n {
# N# k5 m v( J# G* f TForm::CreateParams(Params); // call base class first
( K* o1 E4 u: p/ g* j: h Params.ExStyle |= WS_EX_CLIENTEDGE; // then add the style
: K2 L0 T1 c. h# L$ c } 5 I9 e1 n0 L5 b+ D$ j: Y1 ~+ b
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. : v; U4 D) ~( C, h9 j6 A* s
|