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 4083004
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:15:29+00:00 2026-05-20T18:15:29+00:00

I am resetting the size of a Form in a Control derived from Panel

  • 0

I am resetting the size of a Form in a Control derived from Panel in the OnLayout handler after changing the control’s size.

panel->ClientSize = size;
this->Parent->ClientSize = 
    System::Drawing::Size(
        this->Parent->ClientSize.Width, 
        this->Parent->ClientSize.Height-difference);

Stepping through the code with the debugger shows that the change in location happens when the Form’s ClientSize is changed. The Panel is NOT Anchored to the Form.

The problem I’m having is that this causes the controls location to change.

>>> FormPanel::layoutPanel - {X=604,Y=0}{Width=766, Height=250}
FormPanel::layoutPanel Height set - {X=604,Y=0}{Width=766, Height=217}
FormPanel - OnSizeChanged:{X=604,Y=0}{Width=766, Height=217}
FormPanel - OnLocationChanged:{X=604,Y=-17}{Width=766, Height=217}
FormPanel - OnMove:{X=604,Y=-17}{Width=766, Height=217}
Setting Form1->ClientSize = {Width=1370, Height=217}
<<< FormPanel::layoutPanel - {X=604,Y=-17}{Width=766, Height=217}

I get two events and the control has moved to Y = -17.

The questions I have are:

1) What is the difference between OnLocationChanged and OnMove?

2) Why has it moved?

3) Am I doing anything wrong here?

  • 1 1 Answer
  • 0 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. Editorial Team
    Editorial Team
    2026-05-20T18:15:29+00:00Added an answer on May 20, 2026 at 6:15 pm

    I would check to see how the control is anchored to it’s parent.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I best determine the Size of a Class from Memory? Here is
If I re-size the panel to the TOP or to the LEFT , its
I want after user typing every time in input run resetting countdown, i add
As an extension of this question : TForm.OnResize is sometimes fired before a form
These are the steps: POST Form (file/image input) from the browser goes to a
I'm wondering how people are currently resetting their data / cleaning up test remnants
Is there a way of resetting QUnit tests without reloading the page ? On
I am experiencing an issue with v1 of Ninject and resetting the StandardKernel. I
My idea was to copy a dictionary while resetting all the values of the
The action I'm repeating over and over is transplanting my changes from default to

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.