I've been using these functions to make sure that the objects in my Windows Forms application resize properly when the user changes the window size. It's been working great for most of the objects!
However, I ran into a little hiccup when I tried using the functions with the pages object (Bunifu Pages). It's a bit weird because when the user expands the window, everything works fine and the pages object adjusts accordingly. But when they try to make the window smaller, the pages object doesn't seem to respond and stays the same size.
rec_Pages = new Rectangle(Pages.Location, Pages.Size);
rec_ConnectButton = new Rectangle(ConnectButton.Location, ConnectButton.Size);
rec_RefreshPorts = new Rectangle(RefreshPorts.Location, RefreshPorts.Size);
rec_BaudLabel = new Rectangle(BaudLabel.Location, BaudLabel.Size);
rec_BaudDropdown = new Rectangle(BaudDropdown.Location, BaudDropdown.Size);
rec_PortsDropDown = new Rectangle(PortsDropDown.Location, PortsDropDown.Size);
rec_PortLabel = new Rectangle(PortLabel.Location, PortLabel.Size);
private void Form1_Resize(object sender, EventArgs e)
{
resize_Control(Pages, rec_Pages);
//first panel(connection)
resize_Control(ConnectButton, rec_ConnectButton);
resize_Control(RefreshPorts, rec_RefreshPorts);
resize_Control(BaudLabel, rec_BaudLabel);
resize_Control(PortLabel, rec_PortLabel);
resize_Control(PortsDropDown, rec_PortsDropDown);
resize_Control(BaudDropdown, rec_BaudDropdown);
}
private void Form1_Resize(object sender, EventArgs e)
{
resize_Control(Pages, rec_Pages);
resize_Control(ConnectButton, rec_ConnectButton);
resize_Control(RefreshPorts, rec_RefreshPorts);
resize_Control(BaudLabel, rec_BaudLabel);
resize_Control(PortLabel, rec_PortLabel);
resize_Control(PortsDropDown, rec_PortsDropDown);
resize_Control(BaudDropdown, rec_BaudDropdown);
}
I tried changing the bunifu pages properties, but I didn't find anything that would help.