[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Frame not appoearing on Form

Posted on 2004-11-28
Medium Priority
Last Modified: 2010-04-05
I have made extensive use of inherited forms in an application and am looking to use frames to individualise some aspects of the interface.

I am new to frames and with a simple test program to see how they work, my test frame did not appear on the form.

I did the following:

I created a new Form and added a button.

I then created a Frame with a different colour to the Form, and some labels (ie something to see).

I declared the frame as a variable on the form i.e

  Form1: TForm1;
  Frame1: TFrame;

I then put the following code behind the Onclick event of the button I placed on the form

  if Frame1 = nil then
     Frame1 := TFrame.Create(self);
  Frame1.Visible := true;
  Frame1.Align := alTop;
  Frame1.Parent := Form1;

I have also used


When I run the program, and click the button, I can't see the frame. However, if I leave some extraneous labels on the form where the frame it to appear, these disappear when I click the button ie, the frame is there in some spiritual form, but I can't see it. What else do I need to do?

I expect this is an easy question for the gurus, but it is worth 200 points (not 50) to me.

Question by:Dennis_Treacy
LVL 17

Accepted Solution

mokule earned 800 total points
ID: 12692497
i can only guess (as You don't provide whole code)

If You have something like this
  TFrame1 = class(TFrame)

You should have

  Form1: TForm1;
  Frame1: TFrame1;  // not TFrame

  if Frame1 = nil then
     Frame1 := TFrame1.Create(self);  // not TFrame
  Frame1.Visible := true;
  Frame1.Align := alTop;
  Frame1.Parent := Form1;

Author Comment

ID: 12692581

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month19 days, 9 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question