Computer Hope

Software => Computer programming => Topic started by: zaryk on April 18, 2008, 06:23:34 AM

Title: c#sharpdevelop window size
Post by: zaryk on April 18, 2008, 06:23:34 AM
How would I go about checking the mainform window size?  I am wanting to write an if then state that more or less says that

Code: [Select]
if (window size ==  (360, 105)){
       do whatever
}

or

Code: [Select]
if (window size == minimum size){         // (360, 105) is the minimum size for the window
      do whatever
}
Title: Re: c#sharpdevelop window size
Post by: Sidewinder on April 18, 2008, 12:16:17 PM
Forms have a width and height property which you can check after the fact:

Code: [Select]
if form.width < 360 Or form.height < 105 {
    do errorcondition
}

You could also do this in the onResize event for the form and notify the user immediately if the form goes below the minimum size.

I'm learning C# just researching your questions. ;)

Good luck.
Title: Re: c#sharpdevelop window size
Post by: zaryk on April 20, 2008, 01:02:06 PM
cool, thanks.