65.9K
CodeProject is changing. Read more.
Home

Dragging a Borderless Form

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.60/5 (5 votes)

Jun 13, 2010

CPOL
viewsIcon

7033

The original snippet I made is in VB.NETProtected Overrides Sub WndProc(ByRef e As Message) MyBase.WndProc(e) If e.Msg = &H84 AndAlso e.Result = &H1 Then e.Result = &H2 End SubI used Reflector to translate it to C#protected override void WndProc(ref Message...

The original snippet I made is in VB.NET
Protected Overrides Sub WndProc(ByRef e As Message)
       MyBase.WndProc(e)
       If e.Msg = &H84 AndAlso e.Result = &H1 Then e.Result = &H2
   End Sub
I used Reflector to translate it to C#
protected override void WndProc(ref Message e)
{
    base.WndProc(ref e);
    if ((((e.Msg == 0x84) && (e.Result == ((IntPtr) 1))) ? 1 : 0) != 0)
    {
        e.Result = (IntPtr) 2;
    }
}
Nearly the same code, but the second condition I check for here is different.