/// <summary>Gets the display area of the control's tab pages.</summary>
/// <returns>A <see cref="T:System.Drawing.Rectangle"></see> that represents the display area of the tab pages.</returns>
/// <filterpriority>1</filterpriority>
/// <PermissionSet><IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" /><IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" /><IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" /><IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" /></PermissionSet>
public override Rectangle DisplayRectangle
{
get
{
if (!this.cachedDisplayRect.IsEmpty)
{
return this.cachedDisplayRect;
}
Rectangle rectangle1 = base.Bounds;
System.Windows.Forms.NativeMethods.RECT rect1 = System.Windows.Forms.NativeMethods.RECT.FromXYWH(rectangle1.X, rectangle1.Y, rectangle1.Width, rectangle1.Height);
if (!base.IsDisposed)
{
if (!base.IsActiveX && !base.IsHandleCreated)
{
this.CreateHandle();
}
if (base.IsHandleCreated)
{
base.SendMessage(0x1328, 0, ref rect1);
}
}
Rectangle rectangle2 = Rectangle.FromLTRB(rect1.left, rect1.top, rect1.right, rect1.bottom);
Point point1 = base.Location;
rectangle2.X -= point1.X;
rectangle2.Y -= point1.Y;
this.cachedDisplayRect = rectangle2;
return rectangle2;
}
}其中有一段:
System.Windows.Forms.NativeMethods.RECT rect1 = System.Windows.Forms.NativeMethods.RECT.FromXYWH(rectangle1.X, rectangle1.Y, rectangle1.Width, rectangle1.Height);我就糊涂了。. public static System.Windows.Forms.NativeMethods.RECT FromXYWH(int x, int y, int width, int height)
{
return new System.Windows.Forms.NativeMethods.RECT(x, y, x + width, y + height);
}x+width,y+height有什么意义吗?
/// <returns>A <see cref="T:System.Drawing.Rectangle"></see> that represents the display area of the tab pages.</returns>
/// <filterpriority>1</filterpriority>
/// <PermissionSet><IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" /><IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" /><IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" /><IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" /></PermissionSet>
public override Rectangle DisplayRectangle
{
get
{
if (!this.cachedDisplayRect.IsEmpty)
{
return this.cachedDisplayRect;
}
Rectangle rectangle1 = base.Bounds;
System.Windows.Forms.NativeMethods.RECT rect1 = System.Windows.Forms.NativeMethods.RECT.FromXYWH(rectangle1.X, rectangle1.Y, rectangle1.Width, rectangle1.Height);
if (!base.IsDisposed)
{
if (!base.IsActiveX && !base.IsHandleCreated)
{
this.CreateHandle();
}
if (base.IsHandleCreated)
{
base.SendMessage(0x1328, 0, ref rect1);
}
}
Rectangle rectangle2 = Rectangle.FromLTRB(rect1.left, rect1.top, rect1.right, rect1.bottom);
Point point1 = base.Location;
rectangle2.X -= point1.X;
rectangle2.Y -= point1.Y;
this.cachedDisplayRect = rectangle2;
return rectangle2;
}
}其中有一段:
System.Windows.Forms.NativeMethods.RECT rect1 = System.Windows.Forms.NativeMethods.RECT.FromXYWH(rectangle1.X, rectangle1.Y, rectangle1.Width, rectangle1.Height);我就糊涂了。. public static System.Windows.Forms.NativeMethods.RECT FromXYWH(int x, int y, int width, int height)
{
return new System.Windows.Forms.NativeMethods.RECT(x, y, x + width, y + height);
}x+width,y+height有什么意义吗?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货