Create and invoke frame under XE

Source: Internet
Author: User

1. Create Form1;

2. Creation of Fmxframe (New-Other->delphi Files, fmxframe); The unit name is Unitframe, the form named frm puts a button in the form, a memo, and here is just a test with a wood reference to it.

3. Call.

Uses    unitframe;var    frm:tfrm;begin  frm: = UnitFrame.TFrm.Create (self);    First create the  frm. Name: = ' frm1 ';  frm. Speedbutton1.text: = ' this is test! ';  frm. Parent: = self. Rectangle1;          Select Parent object to place on Rectanglel above  frm. Memo1.Lines.Add (frm. Name) End;
Tests can be added.

This idea, like creating a component dynamically, defines an object of that component class, creates it, and then selects the parent class.

Perhaps the essence of object-oriented I am not so clear, but slowly learn more, naturally understand it.

Just said here, then I went to the mother there to fill a lesson, so understand the best:

The frm is an object of the Tfrm class, and this object is actually a pointer, which must be created when used, so the object is the same,

Therefore, frm is required: = UnitFrame.TFrm.Crate (self);

Create and invoke frame under XE

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.