Click here to Skip to main content
15,906,625 members
Home / Discussions / C#
   

C#

 
GeneralRe: typeof operator Pin
George_George22-Nov-08 23:59
George_George22-Nov-08 23:59 
GeneralRe: typeof operator Pin
Ed.Poore23-Nov-08 1:04
Ed.Poore23-Nov-08 1:04 
QuestionSystem.Double (CLR type) vs double (C# type) Pin
devvvy22-Nov-08 22:02
devvvy22-Nov-08 22:02 
AnswerRe: System.Double (CLR type) vs double (C# type) Pin
Christian Graus22-Nov-08 22:34
protectorChristian Graus22-Nov-08 22:34 
AnswerRe: System.Double (CLR type) vs double (C# type) Pin
Dave Kreskowiak23-Nov-08 5:16
mveDave Kreskowiak23-Nov-08 5:16 
QuestionLINQ to SQL question, what would be the effect if I change the database table structure ??1 Pin
Nadia Monalisa22-Nov-08 20:39
Nadia Monalisa22-Nov-08 20:39 
AnswerRe: LINQ to SQL question, what would be the effect if I change the database table structure ??1 Pin
Mark Churchill23-Nov-08 12:16
Mark Churchill23-Nov-08 12:16 
GeneralRe: LINQ to SQL question, what would be the effect if I change the database table structure ??1 Pin
Nadia Monalisa23-Nov-08 12:32
Nadia Monalisa23-Nov-08 12:32 
Question.NET Connection pooling max/min setting vs Perfmon Pin
devvvy22-Nov-08 20:25
devvvy22-Nov-08 20:25 
AnswerRe: .NET Connection pooling max/min setting vs Perfmon Pin
Dave Kreskowiak23-Nov-08 5:13
mveDave Kreskowiak23-Nov-08 5:13 
GeneralRe: .NET Connection pooling max/min setting vs Perfmon Pin
devvvy23-Nov-08 15:22
devvvy23-Nov-08 15:22 
GeneralRe: .NET Connection pooling max/min setting vs Perfmon Pin
Dave Kreskowiak24-Nov-08 16:36
mveDave Kreskowiak24-Nov-08 16:36 
Questionsignature of _inp and _outp in msvcrt.dll Pin
asugix22-Nov-08 16:25
asugix22-Nov-08 16:25 
QuestionThread.Abort and IL Pin
devvvy22-Nov-08 13:27
devvvy22-Nov-08 13:27 
AnswerRe: Thread.Abort and IL Pin
Guffa22-Nov-08 14:16
Guffa22-Nov-08 14:16 
GeneralRe: Thread.Abort and IL Pin
devvvy22-Nov-08 14:34
devvvy22-Nov-08 14:34 
GeneralRe: Thread.Abort and IL Pin
Guffa22-Nov-08 17:01
Guffa22-Nov-08 17:01 
GeneralRe: Thread.Abort and IL Pin
devvvy22-Nov-08 17:03
devvvy22-Nov-08 17:03 
QuestionUSB + C# Pin
E_Gold22-Nov-08 8:34
E_Gold22-Nov-08 8:34 
AnswerRe: USB + C# Pin
Christian Graus22-Nov-08 8:52
protectorChristian Graus22-Nov-08 8:52 
GeneralRe: USB + C# Pin
E_Gold22-Nov-08 9:15
E_Gold22-Nov-08 9:15 
GeneralRe: USB + C# Pin
Christian Graus22-Nov-08 9:56
protectorChristian Graus22-Nov-08 9:56 
GeneralRe: USB + C# Pin
Luc Pattyn22-Nov-08 9:27
sitebuilderLuc Pattyn22-Nov-08 9:27 
GeneralRe: USB + C# Pin
Wendelius22-Nov-08 10:56
mentorWendelius22-Nov-08 10:56 
QuestionWM_NCCALCSIZE resizing form continuously Pin
Chris Copeland22-Nov-08 8:09
mveChris Copeland22-Nov-08 8:09 
Hey.

I'm currently hijacking the WM_NCCALCSIZE function to define a custom caption and border areas.
But i'm having an issue with the form constantly resizing itself.

When I maximise the form, it fills the screen like I want it to, but when I restore it back, it's height and width properties are decreased.
I know where in the code it's happening, but I don't know how to stop it from constantly reducing in size, but rather maintain it's original size and simply "append" the non-client area. Any help would be appreciated Smile | :)

Here's the function for the WM_NCCALCSIZE calculations:

protected void WndNCCalcSize(ref Message m)
{
    NativeMethods.NCCALCSIZE_PARAMS para = new NativeMethods.NCCALCSIZE_PARAMS();
    NativeMethods.RECT winRect;

    if (m.WParam == IntPtr.Zero)
        winRect = (NativeMethods.RECT)Marshal.PtrToStructure(m.LParam, typeof(NativeMethods.RECT));
    else
    {
        para = (NativeMethods.NCCALCSIZE_PARAMS)Marshal.PtrToStructure(m.LParam, typeof(NativeMethods.NCCALCSIZE_PARAMS));
        winRect = para.rgrc0;
    }

    IntPtr HDC = NativeMethods.GetWindowDC(this.Handle);

    // Here's where I believe i'm having issues. It'll always continuosly reduce here because it's resizing the window
    // I know if I set the winRect.Top and winRect.Bottom to resize parallel to each other it'll work okay
    // But then it won't display the border. Any ideas? :\
    winRect.Top = winRect.Top + CaptionHeight;
    winRect.Bottom = winRect.Bottom - 3;
    winRect.Left = winRect.Left + 2;
    winRect.Right = winRect.Right - 2;

    this.BRect = winRect;

    if (m.WParam == IntPtr.Zero)
        Marshal.StructureToPtr(winRect, m.LParam, false);
    else
    {
        para.rgrc0 = winRect;
        Marshal.StructureToPtr(para, m.LParam, false);
    }

    NativeMethods.ReleaseDC(this.Handle, HDC);

    m.Result = new IntPtr(NativeMethods.WVR_REDRAW);

    base.WndProc(ref m);
}


Thanks.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.