on maximum size changed

Z

zach

Could someone please refer me to an example
of implementing on maximum size changed.
I am wanting to do things when a form is minimized
and believe I can use on maximum size changed
to spark a method containing code to do the
things I want done.

Thanks,
Zach
 
Z

zach

Peter Duniho said:
zach said:
Could someone please refer me to an example
of implementing on maximum size changed.
I am wanting to do things when a form is minimized [...]

I would use the WindowStateChanged event instead. Any particular reason
you want to use the MaximumSizeChanged event instead? Especially since
minimizing a window isn't likely to cause that event to be raised?

Pete

Hi Pete,
You will be right. Could you please refer me to an example?
Many thanks,
Zach.
 
Z

zach

Peter Duniho said:
zach said:
[...]
I would use the WindowStateChanged event instead. Any particular reason
you want to use the MaximumSizeChanged event instead? Especially since
minimizing a window isn't likely to cause that event to be raised?

Hi Pete,
You will be right. Could you please refer me to an example?

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.sizechanged.aspx

Note that there's no WindowStateChanged event. I misspoke. You need to
track the SizeChanged event, and check the WindowState property to see if
it's changed from the last known value.

Pete
 
Z

zach

Peter Duniho said:
zach said:
[...]
I would use the WindowStateChanged event instead. Any particular reason
you want to use the MaximumSizeChanged event instead? Especially since
minimizing a window isn't likely to cause that event to be raised?

Hi Pete,
You will be right. Could you please refer me to an example?

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.sizechanged.aspx

Note that there's no WindowStateChanged event. I misspoke. You need to
track the SizeChanged event, and check the WindowState property to see if
it's changed from the last known value.

Pete

Pete, no sound on minimizing

public sealed partial class MainForm : Form
{
#region Instantiations.
Rectangle screen = Screen.PrimaryScreen.WorkingArea;
int size;
#endregion

#region Constructor.
public MainForm()
{
InitializeComponent();
// som code
this.SizeChanged +=new EventHandler(MainForm_SizeChanged);
size = screen.Width;

}
#endregion

void MainForm_SizeChanged(object sender, EventArgs e)
{
if(this.Width != size)
new Displays.WarnSound();
}

// some code
 
Z

zach

Peter Duniho said:
zach said:
[...]
I would use the WindowStateChanged event instead. Any particular reason
you want to use the MaximumSizeChanged event instead? Especially since
minimizing a window isn't likely to cause that event to be raised?

Hi Pete,
You will be right. Could you please refer me to an example?

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.sizechanged.aspx

Note that there's no WindowStateChanged event. I misspoke. You need to
track the SizeChanged event, and check the WindowState property to see if
it's changed from the last known value.

Pete

Pete I don't know how to do the SizeF stuff - establishing the size of the
display.

SizeF was = (SizeF)this.size;

is no good, what hould it be so I can compare was with is?
Zach.
 
Z

zach

zach said:
Peter Duniho said:
zach said:
[...]
I would use the WindowStateChanged event instead. Any particular
reason you want to use the MaximumSizeChanged event instead?
Especially since minimizing a window isn't likely to cause that event
to be raised?

Hi Pete,
You will be right. Could you please refer me to an example?

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.sizechanged.aspx

Note that there's no WindowStateChanged event. I misspoke. You need to
track the SizeChanged event, and check the WindowState property to see if
it's changed from the last known value.

Pete

Pete I don't know how to do the SizeF stuff - establishing the size of the
display.

SizeF was = (SizeF)this.size;

is no good, what hould it be so I can compare was with is?
Zach.

I have found out how to do it.

new Size( ..., ....)

Many thanks,
Zach.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top