I am building a basic Image editor. In my app, if the user wants to resize the image a new form pops up and asks the user to input an new width and height for the image.
<Setup properties in your "resize" class for the values you want to retrieve. For example, if you add a width property:
public int Width { get; set; }
you will be able to get the width from your Form1 class.
I assume there are a number of ways to do this. I'd probably use public properties on the resizeForm and then get those when the resizeForm.ShowDialog() returns.
if (resizeForm.ShowDialog() == DialogResult.OK) // or whatever
{
myVal = resizeForm.Val;
...
}
or something like that.
Add properties to your resize form that your main form can interrogate after the resize form is closed, like ...
DialogResult dr = resizeForm.ShowDialog();
if( dr != DialogResult.Cancel )
{
var newH = resizeForm.Height;
var newW = resizeForm.Width;
// do something with new vals.
}