Topic: iconize via script
Hi, MVD Guru, how can I iconize the form via script? How can make it draggable by mouse via script? Is possible?
Thanks Riccardo.
My Visual Database → Script → iconize via script
Hi, MVD Guru, how can I iconize the form via script? How can make it draggable by mouse via script? Is possible?
Thanks Riccardo.
Hello,
Can you let me more info, what is it "iconize" ?
I would use a form without borders without default buttons for closing ... from here all right; Now I would like my form is draggable, and that via a button I can reduce it to an icon in the windows bar.
thanks Riccardo
Hello madbit71
In fact, you want hide and restore your application to and from taskbar, isn'it ?
If MVD accepts Application.MainFormOnTaskbar event (I ask question to Dmitry), you can put it to True
So to minimize your application :
Use : MyApplication.MyForm.Visible := False.
MyApplication.Minimize;
MyApplication.MyForm.Visible := False;
and to restore it
MyApplication.MyForm.Visible := True;
MyApplication.Restore;
It can be a clue for your question
JB
I would use a form without borders without default buttons for closing ... from here all right; Now I would like my form is draggable, and that via a button I can reduce it to an icon in the windows bar.
thanks Riccardo
you can do it using script, except reduce it to an icon in the windows bar.
script
var
isMouseDown: boolean;
offx, offy: integer;
procedure Form1_OnMouseMove (Sender: string; Shift, Alt, Ctrl: boolean; X, Y: Integer);
begin
if isMouseDown then
begin
Form1.Left := Form1.Left - offx + X;
Form1.Top := Form1.Top - offy + Y;
end;
end;
procedure Form1_OnMouseDown (Sender: string; MouseLeft, MouseRight, MouseMiddle: boolean; Shift, Alt, Ctrl: boolean; X, Y: Integer);
begin
if MouseLeft then
begin
isMouseDown := True;
offx := x;
offy := y;
end;
end;
procedure Form1_OnMouseUp (Sender: string; MouseLeft, MouseRight, MouseMiddle: boolean; Shift, Alt, Ctrl: boolean; X, Y: Integer);
begin
if MouseLeft then isMouseDown := False;
end;
begin
Form1.BorderStyle := bsNone;
Form1.mniFile.Visible := False;
Form1.mniOptions.Visible := False;
Form1.mniAbout.Visible := False;
end.
also you can download project:
Great...it's perfect...my form is draggable...thank you.
Riccardo.
My Visual Database → Script → iconize via script
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi