Topic: click the button to add a new text box

Hi all
how to make a button that has a function to add a new texs box to a form.
example: click one time add one new textbox, click the second one add one more, and so on. Please help, thank you

Re: click the button to add a new text box

Hello.


procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
    Edit: TdbEdit;
begin
    Edit := TdbEdit.Create(Form1);
    Edit.Parent := Form1;
    Edit.Left := 8;
    Edit.Top := Form1.Tag;
    Form1.Tag := Form1.Tag + 24;
end;
Dmitry.

3 (edited by yandi.indera 2019-07-25 02:53:41)

Re: click the button to add a new text box

Hi Dmitry...

Thank you buddy for your help. but so far I haven't managed to apply it to the button. if you don't mind please give me an example in the form of a project. I beg you for enlightenment from you, thank you very much.

Post's attachments

Attachment icon exp.png 155.02 kb, 219 downloads since 2019-07-25 

Re: click the button to add a new text box

.

Post's attachments

Attachment icon test.7z 2.57 kb, 289 downloads since 2019-07-25 

5 (edited by yandi.indera 2019-07-27 17:55:54)

Re: click the button to add a new text box

sibprogsistem

I am very grateful for the help. I tried it and it went well. I have also tried to complete this section, but I am still having difficulty in the steps to save the contents of several text boxes into one group and then displayed in single column in Gridtable view. friend, does the solution have to use scripts too? if you don't mind, I expect enlightenment from you. please help,
I'm a beginner and still learning your help will become an insight enhancer for me.
Thank you buddy

6 (edited by sibprogsistem 2019-07-28 16:41:58)

Re: click the button to add a new text box

Ув. Дмитрий, не моглибы Вы дополнить этот проект

1. создать возможность перемещать панель с едитом по форме
2. при удалении панель сбрасывать или как-то поднимать нижнии понели

Post's attachments

Attachment icon test_2.7z 7.22 kb, 327 downloads since 2019-07-28 

Re: click the button to add a new text box

Amazing...
Thank you buddy for your enlightenment,
this is very helpful for people who are still learning like me.
Once again, thank you