❔ A problem about sizing

GGroophy1/8/2023
Even though I write most of the code, a problem is preventing it from working properly.
I will write the description after I open the channel
GGroophy1/8/2023
Image
GGroophy1/8/2023
Sizing algorithm
GGroophy1/8/2023
Image
GGroophy1/8/2023
blue line is distance
GGroophy1/8/2023
and distance value showing in top
GGroophy1/8/2023
Sizing should be proportional to the form so distance shouldn't change but it does
GGroophy1/8/2023
I can give you the information you want
GGroophy1/8/2023
Form's code
Responsive.Sizing sizing = new Sizing(this);

            sizing.CreateNewConnection(button2, button1, Sizing.MarginSection.Left);
            sizing.CreateNewConnection(button3, button1, Sizing.MarginSection.Top);
            sizing.CreateNewConnection(button4, button1, Sizing.MarginSection.Top);
            
            sizing.CreateNewConnection(button4, button3, Sizing.MarginSection.Left);
            sizing.CreateNewConnection(button5, button3, Sizing.MarginSection.Top);
            sizing.CreateNewConnection(button6, button3, Sizing.MarginSection.Top);
            
            sizing.CreateNewConnection(button6, button5, Sizing.MarginSection.Left);
            sizing.CreateNewConnection(button8, button7, Sizing.MarginSection.Left);
            sizing.CreateNewConnection(button7, button5, Sizing.MarginSection.Top);
            sizing.CreateNewConnection(button8, button5, Sizing.MarginSection.Top);
            
            sizing.IgnoreControlWhenSizing(Menubar);
            sizing.IgnoreControlWhenSizing(miniToolStrip);
GGroophy1/8/2023
to get double value CurrentWidth/FirstWidth as px
double px = (double)((Control)sender).Width / (double)initWidth;
to size FirstWidth*px
int newWidth = (int)(sizeInits[cntl].Width * px);
PPlayboi171/8/2023
I don’t know what your problem is? The buttons appear to resize fine
GGroophy1/9/2023
Actually, I wanted the button to grow in line with the form, so the distance (blue line) between the button and the form should not change.
AAccord1/10/2023
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.