C
C#2y ago
Groophy

❔ A problem about sizing

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
7 Replies
Groophy
Groophy2y ago
Sizing algorithm
Groophy
Groophy2y ago
Groophy
Groophy2y ago
blue line is distance and distance value showing in top Sizing should be proportional to the form so distance shouldn't change but it does I can give you the information you want 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);
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);
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);
Playboi17
Playboi172y ago
I don’t know what your problem is? The buttons appear to resize fine
Groophy
Groophy2y ago
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.
Accord
Accord2y ago
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.