|
7 J& X5 g$ n, l4 ^
Answer: 6 X( l# b, O' _/ z, t
You can create a form with a client edge overriding the CreateParams function and adding the WS_EX_CLIENTEDGE style to Params.ExStyle.
# ~, f/ L8 T! _% kStep 1: Add the CreateParams prototype to the form class. - V4 H7 O5 N1 Y( {
private:
( c2 q& c6 o7 ~' w* v$ L void __fastcall CreateParams(TCreateParams & arams);
4 K# o, u4 R6 k$ h" x1 Y9 NStep 2: Code the function. 3 A5 ?3 Z8 {/ i2 G# M x. R* L) u; O
void __fastcall TForm1::CreateParams(TCreateParams & arams)& o/ w8 l0 j0 Z7 A0 ~5 z6 e
{
: P' p6 y# ^* ]* ~ TForm::CreateParams(Params); // call base class first# \7 r# F2 |, k9 O K$ Q( A
Params.ExStyle |= WS_EX_CLIENTEDGE; // then add the style
4 L3 A$ C- H, s/ |* b. A } 5 D& t: _" e: 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.
& E4 H" l" ?4 e4 E) p7 r |