unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm_Workspace_Canvas =
class(TForm)
Button_New: TButton;
procedure Button_NewClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form_Workspace_Canvas: TForm_Workspace_Canvas;
implementation
{$R *.dfm}
var
xPos, yPos: integer;
procedure Shape_BannerMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
xPos := x;
yPos := y;
Form_Workspace_Canvas.AlphaBlendValue := 100;
Form_Workspace_Canvas.AlphaBlend := True;
end;
procedure Shape_BannerMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if HiWord(GetAsyncKeyState(VK_LBUTTON)) > 0
then
begin
Form_Workspace_Canvas.Left := Form_Workspace_Canvas.Left + X - xPos;
Form_Workspace_Canvas.Top := Form_Workspace_Canvas.Top + Y - yPos;
end;
end;
procedure Shape_BannerMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Form_Workspace_Canvas.AlphaBlendValue := 255;
Form_Workspace_Canvas.AlphaBlend := False;
end;
procedure TForm_Workspace_Canvas.Button_NewClick(Sender: TObject);
var
Form_Workspace_Canvas : TForm;
Shape_Banner : TShape;
Shape_Body : TShape;
begin
Form_Workspace_Canvas := TForm.CreateNew(Application);
Form_Workspace_Canvas.Left := 205;
Form_Workspace_Canvas.Top := 35;
Form_Workspace_Canvas.Height := 725;
Form_Workspace_Canvas.Width := 815;
Form_Workspace_Canvas.BorderStyle := bsNone;
Form_Workspace_Canvas.Show;
Shape_Banner := TShape.Create(Form_Workspace_Canvas);
Shape_Body := TShape.Create(Form_Workspace_Canvas);
with Shape_Banner
do
begin
Parent := Form_Workspace_Canvas;
Left := 0;
Top := 0;
Width:= 807;
Height:= 9;
Brush.Color := clGray;
Brush.Style := bsSolid;
Name := '
Shape_Banner';
OnMouseDown := Shape_BannerMouseDown;
// => Fehler!
OnMouseMove := Shape_BannerMouseMove;
// => Fehler!
OnMouseUp := Shape_BannerMouseUp;
// => Fehler!
end;
with Shape_Body
do
begin
Parent := Form_Workspace_Canvas;
Left := 0;
Top := 8;
Width:= 807;
Height:=690;
Brush.Color := clWhite;
Brush.Style := bsSolid;
Name := '
Shape_Body';
end;
end;
end.