Click here to Skip to main content
15,907,905 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# and ms excel spreadsheet Pin
phokojoe23-Feb-07 4:41
phokojoe23-Feb-07 4:41 
QuestionDataGridView and ComboBoxes Pin
crzyank21-Feb-07 5:22
crzyank21-Feb-07 5:22 
AnswerRe: DataGridView and ComboBoxes Pin
led mike21-Feb-07 8:11
led mike21-Feb-07 8:11 
AnswerRe: DataGridView and ComboBoxes Pin
M. Cahid AYDIN21-Feb-07 20:47
M. Cahid AYDIN21-Feb-07 20:47 
QuestionHow to administer my application remotely? Pin
BraveShogun21-Feb-07 4:16
BraveShogun21-Feb-07 4:16 
QuestionAlarm on Event in Event Calendar Pin
fangenius21-Feb-07 3:29
fangenius21-Feb-07 3:29 
QuestionC# childcontrol not editable in designtime. Pin
topcatalpha21-Feb-07 3:26
topcatalpha21-Feb-07 3:26 
AnswerRe: C# childcontrol not editable in designtime. Pin
Martin#21-Feb-07 3:42
Martin#21-Feb-07 3:42 
QuestionDifference between += and -= when defining events Pin
sharpiesharpie21-Feb-07 3:20
sharpiesharpie21-Feb-07 3:20 
AnswerRe: Difference between += and -= when defining events Pin
Martin#21-Feb-07 3:25
Martin#21-Feb-07 3:25 
GeneralRe: Difference between += and -= when defining events Pin
Martin#21-Feb-07 3:35
Martin#21-Feb-07 3:35 
AnswerRe: Difference between += and -= when defining events Pin
Luc Pattyn21-Feb-07 11:07
sitebuilderLuc Pattyn21-Feb-07 11:07 
QuestionSave Jpeg via Web Service Pin
Russell Jones21-Feb-07 3:02
Russell Jones21-Feb-07 3:02 
AnswerRe: Save Jpeg via Web Service Pin
Russell Jones21-Feb-07 4:26
Russell Jones21-Feb-07 4:26 
AnswerRe: Save Jpeg via Web Service Pin
code-frog21-Feb-07 4:44
professionalcode-frog21-Feb-07 4:44 
Questiondifferences between asp and asp.net Pin
Rama krishna.M21-Feb-07 2:59
Rama krishna.M21-Feb-07 2:59 
AnswerRe: differences between asp and asp.net Pin
Russell Jones21-Feb-07 3:05
Russell Jones21-Feb-07 3:05 
GeneralRe: differences between asp and asp.net Pin
lost in transition 21-Feb-07 3:57
lost in transition 21-Feb-07 3:57 
AnswerRe: differences between asp and asp.net Pin
Guffa21-Feb-07 4:57
Guffa21-Feb-07 4:57 
QuestionSecuring SOAP communications with TLS-PSK Pin
AdrianFreemantle21-Feb-07 2:55
AdrianFreemantle21-Feb-07 2:55 
QuestionMDI problem Pin
Jan-Erik Romoeren21-Feb-07 2:49
Jan-Erik Romoeren21-Feb-07 2:49 
Hello,

I have a mdi (painting) problem. I'll try to be short and to the point:

Situation:
I have a MDI form. Instead of having the standard minmize, restore, etc buttons (when the mdi child is maximized) I have my own tabstrip control where I've created those buttons. I also have my own behavior when one child is minimized, maximized or restored, only the one child is changed (the rest keep their state).

How:
First of all, the handling is done by overriding WndProc in the child. I check WM_SIZE to see if the child is SIZE_MAXIMIZED, if it is I set WindowState to Normal, and dock the child instead (otherwise I'll get the system buttons as normal mdi behavior). I also check when the systembuttons are clicked, and dock instead of maximize, etc.

Problem:
When changing through the childs I have ALOT of flicker, and one of the main problems is that I see the caption bar of the child for a split second. I think that's what causing the flicker (or at least much of it), because the child and it's controls are doing a lot of resizing and moving. If I return when I get the WM_NCACTIVATE message, there's no flicker, but of course I can't return, that's just causing a lot of other problems.

So, does anyone have any suggestions how to get rid of the flicker, or how to NOT paint the caption bar?

Here's the WndProc override:

<br />
        protected override void WndProc(ref Message m)<br />
        {<br />
            if (this.blockWndProc)<br />
                return;<br />
<br />
            if (m.Msg == WM_SYSCOMMAND || m.Msg == WM_NCLBUTTONDBLCLK)<br />
            {<br />
                if (this.Parent != null)<br />
                {<br />
                    if ((int)m.WParam == SC_MAXIMIZE || (int)m.WParam == HTCAPTION)<br />
                    {<br />
                        this.Dock = DockStyle.Fill;<br />
                        return;<br />
                    }<br />
                    if ((int)m.WParam == SC_RESTORE)<br />
                    {<br />
                        this.Dock = DockStyle.None;<br />
                        this.Size = this.restoreSize;<br />
                        return;<br />
                    }<br />
                }<br />
            }<br />
<br />
            if (m.Msg == WM_SIZE)<br />
            {<br />
                if ((int)m.WParam == SIZE_MAXIMIZED && this.Parent != null)<br />
                {<br />
                    this.restoreSize = this.RestoreBounds.Size;<br />
<br />
		    // Unfortunately this flag didn't do the trick...<br />
                    this.blockWndProc = true;<br />
                    this.WindowState = FormWindowState.Normal;<br />
                    this.blockWndProc = false;<br />
<br />
                    this.Dock = DockStyle.Fill;<br />
                }<br />
            }<br />
<br />
<br />
            base.WndProc(ref m);<br />
        }<br />

AnswerRe: MDI problem Pin
Martin#21-Feb-07 3:51
Martin#21-Feb-07 3:51 
GeneralRe: MDI problem Pin
Jan-Erik Romoeren22-Feb-07 21:59
Jan-Erik Romoeren22-Feb-07 21:59 
AnswerRe: MDI problem Pin
Bekjong21-Feb-07 4:42
Bekjong21-Feb-07 4:42 
GeneralRe: MDI problem Pin
Jan-Erik Romoeren22-Feb-07 22:10
Jan-Erik Romoeren22-Feb-07 22:10 

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.