Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: c#sharpdevelop window size  (Read 3949 times)

0 Members and 2 Guests are viewing this topic.

zaryk

  • Guest
c#sharpdevelop window size
« 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
}

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: c#sharpdevelop window size
« Reply #1 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.
« Last Edit: April 18, 2008, 12:31:27 PM by Sidewinder »
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

zaryk

  • Guest
Re: c#sharpdevelop window size
« Reply #2 on: April 20, 2008, 01:02:06 PM »
cool, thanks.