Click here to Skip to main content
15,897,518 members
Home / Discussions / C#
   

C#

 
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 
QuestionScroll With Code Pin
MHASSANF21-Feb-07 2:29
MHASSANF21-Feb-07 2:29 
AnswerRe: Scroll With Code Pin
K.P.Kannan21-Feb-07 20:44
K.P.Kannan21-Feb-07 20:44 
QuestionRe: Scroll With Code Pin
MHASSANF23-Feb-07 21:25
MHASSANF23-Feb-07 21:25 
QuestionAjax Calender (new) Control can not work properly with Dynamic updated panel Pin
jaganil21-Feb-07 2:15
jaganil21-Feb-07 2:15 
AnswerRe: Ajax Calender (new) Control can not work properly with Dynamic updated panel Pin
ednrgc21-Feb-07 2:55
ednrgc21-Feb-07 2:55 
GeneralRe: Ajax Calender (new) Control can not work properly with Dynamic updated panel Pin
jaganil24-Feb-07 1:38
jaganil24-Feb-07 1:38 
QuestionCustom DashStyle Pin
MHASSANF21-Feb-07 1:42
MHASSANF21-Feb-07 1:42 
AnswerRe: Custom DashStyle Pin
Guffa21-Feb-07 2:12
Guffa21-Feb-07 2:12 
GeneralRe: Custom DashStyle Pin
MHASSANF21-Feb-07 2:27
MHASSANF21-Feb-07 2:27 
QuestionHow to Get Value from one form to another form. Pin
Binod K21-Feb-07 1:26
Binod K21-Feb-07 1:26 
AnswerRe: How to Get Value from one form to another form. Pin
Martin#21-Feb-07 2:08
Martin#21-Feb-07 2:08 
GeneralRe: How to Get Value from one form to another form. Pin
led mike21-Feb-07 12:04
led mike21-Feb-07 12:04 
GeneralRe: How to Get Value from one form to another form. Pin
Martin#21-Feb-07 19:54
Martin#21-Feb-07 19:54 

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.