Jump to content

Dynamic creation of components


Recommended Posts

Hi Farhad, need to dynamically create a component, there is a problem with the creation of Label,Edit component.

Attached a test project, if the method uses its DynamicForm.CreateTUniLabel label created!

If DynamicForm.ConstructionForm (5, 'Metka') there are problems, the result of the screenshot.

I apologize in advance for the version I am using Delphi 2007, Build 943, there is no facility to upgrade.

I think the problem is not connected with the version uniGui. Maybe the problem is a variable of type TUniControl.

Thank you.

TestDinamic - ?????.zip





Link to comment
Share on other sites

  • Administrators

You can't create a Form dynamically and then refer to its "static" instance.


Creating a dynamic form doesn't initialize its reference as we define as:


function DynamicForm: TDynamicForm;


Calling DynamicForm() inside a dynamically created form will create a 2nd instance.





	Metka : begin
         	pComponent  	:= Self.CreateTUniLabel;
         	pComponent.Tag  := 1;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...