Edit: I'm using VB.NET in Visual Studio 2019
I have a chart on a modal form with a single ChartArea that displays a line graph. I need the axes of the chart to be scaled 1:1 relative to each other. In other words, no distortion/stretch. I need the the same number of pixels-per-unit on each axis.
I'm able to get the charts axes min and max values (and use an algorithm to force them to be "pretty") numbers. So all I need to do is set the size of the plotted area in pixels based on the ratio of the axes value ranges.
I know the size of the plotted area is dependent on the ChartArea.Position and ChartArea.InnerPlotPosition size properties (which are 0 - 100 values that describe their percentage size relative to their containers). The problem is this: When I poll these properties during the form load, they both come up as zero. The chart displays the data and everything works, I'm just not able to resize it as I want to during load because these size values are apparently not set yet.
If I close the modal form and launch it again, then the properties populate with non-zero values. But I really need it to work the first time.
I've tried using .Refresh(), .Invalidate, and .PerformLayout() on both the Chart and the Form during the load event. I've also tried programmatically launching the form twice in rapid succession. I've tried moving the check of those properties to a subroutine that runs at the end of the form load. Nothing works.
Is there any way to know those size percentages during the load event? Thank you for your help.