Impactnetworking


Borland C ++ Builder FAQ
The content

How animation form appearance as though it is unrolled from the middle?

The author: KAV
The initial link: - - -

At form discovery (OnCreate):
TRect r1, r2;  
r1 = Rect (Left+Width/2,Top+Height/2,Left+Width/2,Top+Height/2); 
r2 = BoundsRect; 
DrawAnimatedRects (Handle,IDANI_CAPTION,&r1,&r2); 
The form will as though be unrolled from the middle.
And that it at closing was contracted into the middle we write in OnClose:
TRect r1, r2;  
r1 = Rect (Left+Width/2,Top+Height/2,Left+Width/2,Top+Height/2); 
r2 = BoundsRect; 
DrawAnimatedRects (Handle,IDANI_CAPTION,&r2,&r1); //the sequence of the last parameters changes only 

How to make the program in "plane" style?

The author: OlegGG

To use packet FlatStyle.

How to make invisible the principal form?

The author: OlegGG

In WinMain, right after "Application-> Initialize ();", we write:
Application-> ShowMainForm = false; 

How to make, that in TEdit it was possible to enter only numbers?

The author: OlegGG

Simply place this code in OnKeyPress any TEdit'а:

if ((Key> = ' 0 ') && (Key <= ' 9 ')) {} //digits 
else if (Key == 8) {} //<- 
else if ((Key == '. ') || (Key == ', '))//a comma 
        { 
        if (((TEdit *) Sender)-> Text. Pos (DecimalSeparator)! =0)//if the comma already is 
                Key = 0; 
        else//if still is not present 
                Key = DecimalSeparator; 
        }
else Key = 0;//not digit 
P.S. DecimalSeparator - global variable - a separator of the whole and fractional part.

How to scroll TMemo or TRichEdit program?

The author: trainer

For the line downwards:
SendMessage (Memo1-> Handle, WM_VSCROLL, MAKEWORD (SB_LINEDOWN, 0), 0); 
For the line upwards:
SendMessage (Memo1-> Handle, WM_VSCROLL, MAKEWORD (SB_LINEUP, 0), 0);