Impactnetworking


Borland C ++ Builder FAQ
The content

How to make the program in style ХР?

The author (): kenai, OlegGG

Possible variants:
  • To use TXPMenu.
  • To create the manifesto-file. About it is more detailed in FAQ'e to VC ++

How to the button to attach a picture?

The author: OlegGG
The initial link: - - -

In tab Additional there is component TBitBtn. We allocate it on the form.
In its properties it is activated Glyph, on the right there is a button with "..."
We push it, in the appeared window it is pushed "Load", and then we open *.BMP a picture file.

Also, it is possible to use TImage or to create own component.

How to the button to attach a picture?

The author: kenai
The initial link: - - -

To the description of all functions it is necessary to write:
TControlCanvas * cc; 
In OnCreate forms:
{ 
cc = new TControlCanvas; 
cc-> Control = Button1; 
}
Now it is possible to fulfill an image output "image.bmp" on Button1 as follows:
Graphics:: TBitmap *Bitmap=new Graphics:: TBitmap; 
Bitmap-> LoadFromFile ("image.bmp"); 
cc-> Draw (0,0, Bitmap); 
delete Bitmap; 
P.S. Remember that at copying of the form or the button the image will be erased. Trace it.

How to push the program in трей?

The author (): kenai, OlegGG
The initial link: - - -

To use TrayIcon from tab Samples and other similar components.

Performance of actions at cursor induction on a component

The author: OlegGG
The initial link: - - -

To fulfill any actions at cursor induction on a visual component, it is necessary to define the handler of event OnMouseEnter of this component.
The following code changes text color of element Label1 on dark blue at induction for it of the mouse cursor:
void __ fastcall TForm1:: OnLabel1MouseEnter (TObject * Sender) { 
   Label1-> Font-> Color = clBlue;     
}
And to fulfill some actions when the cursor abandons a control item, it is necessary to define the handler OnMouseLeave
The following code changes text color of element Label1 on black while the mouse cursor abandons it:
void __ fastcall TForm1:: OnLabel1MouseEnter (TObject * Sender) { 
   Label1-> Font-> Color = clBlack; 
}