HI
I have a problem :
when I enable form color transparent or alpha blend then at run time when i drag the form the dragging speed is low how can I prevent it?
any idea?
best regards
Sina wrote:Mr.Kambiz I need to hide one part of my form to make it more stylish I think it means full transparensy level
But I don't want to use win regions because my form doesn't want a simple shape
thanks
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
btnClose: TButton;
Image: TImage;
procedure FormCreate(Sender: TObject);
procedure btnCloseClick(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses
oaBitmap;
procedure TForm1.FormCreate(Sender: TObject);
var
rgnForm: HRGN;
rgnTemp: HRGN;
begin
BorderStyle := bsNone;
with Image.Picture do
rgnForm := CreateBitmapRgn(Bitmap, Bitmap.Canvas.Pixels[0,0]);
rgnTemp := CreateRectRgnIndirect(btnClose.BoundsRect);
try
CombineRgn(rgnForm, rgnForm, rgnTemp, RGN_OR);
finally
DeleteObject(rgnTemp);
end;
SetWindowRgn(Handle, rgnForm, False);
// Windows owns rgnForm, therefore we might not delete it.
end;
procedure TForm1.btnCloseClick(Sender: TObject);
begin
Close;
end;
end.
Users browsing this forum: No registered users and 4 guests