Topic: FORM

Hello MVD

Is there a possibility to blur a main form after clicking a button to show another form ?

Thanks!

2 (edited by k245 2019-08-16 10:43:47)

Re: FORM

You can change the transparency of the main form when opening child ones. Configure the button to open the window, and then add the code:

procedure MainForm_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
  MainForm.AlphaBlendValue := 125;
  MainForm.AlphaBlend := true;
end;

procedure MainForm_Button1_OnAfterClick (Sender: TObject);
begin
  MainForm.AlphaBlend := false;
end;

http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=5729&download=0

Post's attachments

Attachment icon img-2019-08-16-13-43-21.png 469.63 kb, 142 downloads since 2019-08-16 

Визуальное программирование: блог и телеграм-канал.

Re: FORM

Ok Thank You Sir!

Re: FORM

can you tell me how to minimize a form after click on botton and maximime again after saving or closing that form.

JUST LEARNING, O GOD HELP ME.

Re: FORM

Asifmute wrote:

can you tell me how to minimize a form after click on botton and maximime again after saving or closing that form.

This can be done like this:

procedure frmSecond_btnShowForm_OnClick (Sender: TObject; var Cancel: boolean);
begin
  frmThird.Show;
  frmSecond.WindowState := wsMinimized;
end;

procedure frmThird_OnClose (Sender: TObject; Action: string);
begin
  frmSecond.WindowState := wsNormal;
end;

If open a child form not modal, then the parent form can be minimized.


Unfortunately, if the parent form is the main form of the application, then minimizing it will minimize all forms of the application. The action of the "Open form" or "Show record" button opens the form modally. The ShowRecord() method opens a form modally to.Therefore, you cannot use this code for editing forms.


Perhaps the variant with changing the visibility of forms is suitable for you. This variant does not have the above limitations.

procedure frmMain_Button1_OnAfterClick (Sender: TObject);
begin
  frmMain.Visible := true;
end;

procedure frmMain_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
  frmMain.Visible := false;
end;
Визуальное программирование: блог и телеграм-канал.

Re: FORM

Both option working for me.

JUST LEARNING, O GOD HELP ME.