Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 182989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:02:12+00:00 2026-05-11T15:02:12+00:00

I have a TFrame descendent that has on it a sizable panel which is

  • 0

I have a TFrame descendent that has on it a sizable panel which is a third-party component (TLMDSimplePanel)). The sizing on that panel works great, but I want the frame it is contained in to resize dynamically when the user changes the size of the panel. (The panel has a little sizing thumb grip on it that the user can just click and drag with the mouse).

The code for this frame is below:

unit SizeableFrame;  interface  uses   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,   Dialogs, TcmBaseFrameFrame, LMDCustomControl, LMDCustomPanel, LMDCustomBevelPanel,   LMDSimplePanel, StdCtrls;  type   TcmSizeableFrame = class(TcmBaseFrame)     LMDSimplePanel1: TLMDSimplePanel;     Memo1: TMemo;     Memo2: TMemo;     procedure LMDSimplePanel1Resize(Sender: TObject);     procedure FrameCanResize(Sender: TObject; var NewWidth, NewHeight: Integer;       var Resize: Boolean);   private     { Private declarations }   public     { Public declarations }   end;  var   cmSizeableFrame: TcmSizeableFrame;  implementation  {$R *.dfm}  procedure TcmSizeableFrame.FrameCanResize(Sender: TObject; var NewWidth,   NewHeight: Integer; var Resize: Boolean); begin   inherited;   Resize := True; end;  procedure TcmSizeableFrame.LMDSimplePanel1Resize(Sender: TObject); const   ExpandByPixels = 60; var   MyFrame : TFrame;         begin   inherited;   Self.Height := LMDSimplePanel1.Height + ExpandByPixels;   Self.Width := LMDSimplePanel1.Width  +  ExpandByPixels; end;  end. 

It works wonderfully, if the user is shrinking the the size of the frame, but if they try to stretch it larger than its original bounds, they can only expand it to what appears to be its original size + ExpandByPixels, after which the user cannot continue to fluidly drag it to a larger size.

If they stop, and then click and drag the size grip again, they can then drag it out to a larger size, but again this is constrained in the same way (current size + ExpandByPixels = the outer bound). They can repeat this cycle endlessly, expanding the frame to any size, but not fluidly in one mouse movement, which is what I want.

I have tested this same problem against TForm descendents as well, and get the same symptoms.

What am I missing here?

Thanks in advance for any and all help. 🙂

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:02:13+00:00Added an answer on May 11, 2026 at 3:02 pm

    Have you tried to set the Frame.Autosize to true?
    Or you would need to resize the frame when the mouse moves. So that the contained object could expand while staying within the boundaries of the container.

    Update: some simple code that works with a regular TPanel to resize horizontally…

    type   TFrame5 = class(TFrame)     Panel1: TPanel;     procedure Panel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);     procedure Panel1Resize(Sender: TObject);   end;  implementation  {$R *.dfm}  procedure TFrame5.Panel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin   with Sender as TPanel do   if ssLeft in Shift then   begin     Width := X;   end; end;  procedure TFrame5.Panel1Resize(Sender: TObject); begin   with Sender as TPanel do   begin     (Parent as TFrame).Width := Width + 2*Left;   end; end; 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a visual component that I built from a TFrame (but then registered
Have a fun issue with sharepoint calendar view filtering. That code works fine: SPSecurity.RunWithElevatedPrivileges(delegate()
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Yet another TFrame IDE-registered-component question from me. Thanks for all the help, fellow programmers.
I'm using Delphi 2007 Pro. I have a runtime package that includes a number
I have a TFrame (fraDisplay) with a TTimer (timAnimateDataChange). The timer is used to
Have noticed issue while testing iphone app that if one quickly opens/dismisses a modal
have a table that dynamically generates text boxes in run time. I want to
Have a build process that can't be edited and need to pack another war
I have a project that adds elements to an AutoCad drawing. I noticed that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.