Search
Module:
Directory

Desktop Functions:

Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
RECT (Structures)
.
Summary
Defines the coordinates of the upper-left and lower-right corners of a rectangle.

C# Signature:

[StructLayout(LayoutKind.Sequential)]
struct RECT
{
   public int left;
   public int top;
   public int right;
   public int bottom;

   public RECT(int left, int top, int right, int bottom)
   {
     this.left = left;
     this.top = top;
     this.right = right;
     this.bottom = bottom;
   }

   // Handy method for converting to a System.Drawing.Rectangle
   public Rectangle Rectangle
   {
     // this isn't correct ...
     get { return new Rectangle(this.left, this.top, this.right, this.bottom); }
     // the correct form is this :
     get { return new Rectangle(this.left, this.top, this.right - this.left, this.bottom - this.top) }
   }
}

VB Definition:

Structure RECT
    Public Left, Top, Right, Bottom As Int32
End Structure

Notes:

This can be used when a PInvoke signature requires a "Win32 rectangle," otherwise you should be using System.Drawing.Rectangle.

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.


NEW: SmartAssembly 5.0

Automated Error Reporting: get a volume of crash reports and a complete state of your program whenever it fails, and improve the quality of your program.

Try it for free.

Download Now
 
Access PInvoke.net directly from VS:
Terms of Use
Find References
Show Printable Version
Revisions