Solved

WS_CHILD window

Posted on 2016-09-20
14
61 Views
Last Modified: 2016-09-26
I'm creating a WS_CHILD window. When I drag it using the title bar (caption), it does not paint until I stop dragging.  How can I fix this?
0
Comment
Question by:HLRosenberger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5
14 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 41806765
>>How can I fix this?

Fix what, it is working correctly.
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 41806819
But any other window "paints" as I drag it.  Maybe I'm using the incorrect terminology.  As I drag it, I don't see the window moving.  Only after I stop dragging, do I see it in it's new position.
0
 
LVL 34

Expert Comment

by:it_saige
ID: 41806839
Could you provide an example that replicates the issue?

-saige-
0
More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

 
LVL 1

Author Comment

by:HLRosenberger
ID: 41806854
I override CreateParms:

  Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
        Get

            Const WS_DLGFRAME As Integer = &H400000
            Const WS_CHILD As Integer = &H40000000
             Const WS_EX_TOPMOST As Integer = &H8
           Const WS_EX_NOACTIVATE As Integer = &H8000000
            Const NO_WS_SIZEBOX As Integer = &HFFFBFFFF

            Dim params As CreateParams = MyBase.CreateParams
            params.Style = (params.Style Or WS_CHILD Or WS_DLGFRAME) And NO_WS_SIZEBOX
            params.ExStyle = params.ExStyle Or WS_EX_NOACTIVATE Or WS_EX_TOPMOST
            Return params
       

        End Get
    End Property
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 41806860
I trying to create an on-screen numeric key pad.  I need it to stay on top, not be active, but accept use input.  I need to allow the user to move it - I'd like it to work like a typical window when dragging.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 41807160
Ahh, now I understand.  I've seen that happen before, I'll try to think why it behaved that way.
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 41807430
"I've seen that happen before" - you mean the painting issue?
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 41807453
And there's another issue. - The WS_EX_NOACTIVATE  works OK in that it does not take focus away from my application - the application "receives" the keys that are clicked.   However, if I move the window (keypad), my application loses focus, and I have to click back to give it focus.
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 41808179
Have you tried the WS_CLIPSIBLINGS as well as the WS_CHILD property on this window.  That might cure your painting problem.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 41808187
ps
Const NO_WS_SIZEBOX As Integer = &HFFFBFFFF
what is that?
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 41809030
Const NO_WS_SIZEBOX As Integer = &HFFFBFFFF.  I turn of that bit.   I don't want the form to be resized.

 I added WS_CLIPSIBLINGS . That did not help.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 41809244
Why not stick to using the typical window style constants
        And NO_WS_SIZEBOX
is the same as
        And Not WS_SIZEBOX
where WS_SIZEBOX is &H40000

With the repainting I'm still trying to think what the problem was (it might have just been the same behaviour but caused by something different).
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 41809594
Agree on the constant.  That was just brain freeze on my part.
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 41816108
thanks.
0

Featured Post

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question