offsetrgn (gdi32)
Last changed: anonymous

.
Summary

C# Signature:

[DllImport("gdi32.dll")]
static extern int OffsetRgn(IntPtr hrgn, int nXOffset, int nYOffset);

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Public Sub OffsetHeader(ByRef tmpForm As Form)

    With tmpForm
    If .BorderStyle <> 0 Then
        Dim xoff As Long, yoff As Long

        .ScaleMode = vbPixels

        xoff = (.ScaleX(.Width, vbTwips, vbPixels) - .ScaleWidth) / 2
        yoff = .ScaleY(.Height, vbTwips, vbPixels) - .ScaleHeight - xoff

        Call OffsetRgn(hndRegion, xoff, yoff)
    End If
    End With

End Sub

Alternative Managed API:

Do you know one? Please contribute it!

Documentation
OffsetRgn on MSDN