Hello again. There was a problem with clicking on the edit field. There is a main window in it, three forms are displayed on the buttons that open in the main window. The problem is that when you open the child forms when you click on the edit field the left mouse button does not work but the right one works tell me what is the reason? Project attached.
27 2021-05-14 10:22:14
Re: Resize Form (16 replies, posted in Script)
Everything seems to be sorted out just added a script to each form that opens in the main form:
procedure Form1_OnResize (Sender: TObject; Action: string);
begin
Form1:=frmStart.Panel4.Left;
Form1.Top:=frmStart.Panel4.Top;
Form1.Width:=frmStart.Panel4.Width;
Form1.Height:=frmStart.Panel4.Height;
end;
Now when we open the Form1 button it adjusts to the size of Panel 4
28 2021-05-14 09:45:56
Re: Resize Form (16 replies, posted in Script)
The script probably needs to be written: Click expand the window button 1 is triggered back click in the normal state button 1 is triggered is this possible?
29 2021-05-14 08:30:44
Re: Resize Form (16 replies, posted in Script)
Because when you click expand Form1 or Form2, you can't see the borders at the bottom of the screen. It is possible to make it there so that when you expand or weld frmStart while Form1 or Form2 were fully visible ( which was visible on the right side and the lower basement)
To further understand my idea, I will say that you need to make sure that when you scan the frmStart form to full screen, the other forms also adjust to the size of the frmStart. When I click on expand the main window, Form1 remains partially expanded and as it was before the deployment, while if you click on the Button that calls the form again, the window becomes normal size (full screen) The question is why do I need to click the form call button again to get the desired size?
30 2021-05-14 07:42:21
Re: Resize Form (16 replies, posted in Script)
Because when you click expand Form1 or Form2, you can't see the borders at the bottom of the screen. It is possible to make it there so that when you expand or weld frmStart while Form1 or Form2 were fully visible ( which was visible on the right side and the lower basement)
31 2021-05-14 06:10:24
Re: Resize Form (16 replies, posted in Script)
malitos wrote:Can I ask you a moment again? If you need to see a photo from the Form1 Form table on the Start form, the script I threw something but it doesn't work
frmStart.GridClients.dbItemID
GridClients
you do not have a table with that name
Thank you for seeing the error. You corrected me the above project, where I added 2 windows is it possible to write a script for adding several windows? and if it is not difficult to tell me why they are all opened differently, I would like that when you click on the button, all forms 1 2 3 are equally exactly in relation to the main form
32 2021-05-13 11:33:42
Re: Resize Form (16 replies, posted in Script)
Can I ask you a moment again? If you need to see a photo from the Form1 Form table on the Start form, the script I threw something but it doesn't work
35 2021-05-12 04:30:37
Re: Resize Form (16 replies, posted in Script)
Can it be done somehow via Panel attach Form1 when opening to the panel Please help
36 2021-05-12 03:58:49
Topic: Resize Form (16 replies, posted in Script)
Hi everyone. Please tell me what is my mistake? There is a form frmStart it is the main one, it has a button Button1 when it is clicked, the form Form1 appears but it must be inside the form frmStart while its position must be within the size of the table on the form frmStart
procedure frmStart_OnShow (Sender: TObject; Action: string);
begin
Form1.Parent:= Form1;
Form1.Align:= alCustom;
end;
procedure frmStart_OnResize (Sender: TObject);
begin
if Form1 <> nil then
begin
Form1.Left:= frmStart.ClientWidth div 2 - Form1.Width div 2;
Form1.Top:= frmStart.ClientHeight div 2 - Form1.Height div 2;
end;
end;
procedure frmStart_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
Form1.Show;
Form1.Parent:= frmStart;
Form1.Align:= alCustom;
Form1.Position:= poMainFormCenter;
end;
procedure frmStart_OnClose (Sender: TObject; Action: string);
begin
Form1:= nil;
end;
begin
end.
37 2021-05-11 03:58:29
Re: Вычисление дней А что то не так :) (5 replies, posted in Russian)
Спасибо тебе огромное за помощь! Работает
38 2021-05-08 05:29:02
Re: Вычисление дней А что то не так :) (5 replies, posted in Russian)
procedure Form1_ComboBox1_OnChange (Sender: string); begin if (Form1.ComboBox1.dbItemID <> -1) then getdays; end;
Друг спасибо я все таки что то неправильно опять делаю
Я прикрепил проет помоги помогите пожалуйста написать скрипт чтобы при нажатии на комбобох указываешь дни и он автоматически считает, а то у меня считает но когда уходит за другой месяц ошибку выдает
39 2021-05-07 08:19:23
Re: Вычисление дней А что то не так :) (5 replies, posted in Russian)
Вроде додумался как сделать все чтоб считало дни но вот беда когда выставляешь обратно значение combobox на NULL то ругаеться на эту строчку я ее выделил жирным:
var
mm,dd,yy,vyear:integer;
procedure Form1_ComboBox1_OnChange (Sender: string);
begin
getdays;
end;
procedure Form1_DateTimePicker1_OnChange (Sender: string);
begin
getdays;
end;
procedure getdays;
begin
decodedate(form1.datetimepicker1.date,yy,mm,dd);
vdays := dd + strtoint(form1.combobox1.text);
form1.DateTimePicker2.datetime := encodedate(vdays,mm,dd);
form1.label3.caption := 'BASE DATE + ' + form1.combobox1.Text + ' Years';
end;
begin
end.
в программе пишет "" is not a valid integer value
40 2021-05-07 07:24:44
Topic: Вычисление дней А что то не так :) (5 replies, posted in Russian)
var
mm,dd,yy,vyear:integer;
procedure Form1_ComboBox1_OnChange (Sender: string);
begin
getyears;
end;
procedure Form1_DateTimePicker1_OnChange (Sender: string);
begin
getyears;
end;
procedure getyears;
begin
decodedate(form1.datetimepicker1.date,yy,mm,dd);
vyear := yy + strtoint(form1.combobox1.text);
form1.DateTimePicker2.datetime := encodedate(vyear,mm,dd);
form1.label3.caption := 'BASE DATE + ' + form1.combobox1.Text + ' Years';
end;
begin
end.
Подскажите то же самое только для дней, я уже третий день ломаю голову спасибо