Solved

WS_CHILD window

Posted on 2016-09-20
14
44 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
  • 8
  • 5
14 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
>>How can I fix this?

Fix what, it is working correctly.
0
 
LVL 1

Author Comment

by:HLRosenberger
Comment Utility
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 32

Expert Comment

by:it_saige
Comment Utility
Could you provide an example that replicates the issue?

-saige-
0
 
LVL 1

Author Comment

by:HLRosenberger
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
"I've seen that happen before" - you mean the painting issue?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Author Comment

by:HLRosenberger
Comment Utility
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
Comment Utility
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
Comment Utility
ps
Const NO_WS_SIZEBOX As Integer = &HFFFBFFFF
what is that?
0
 
LVL 1

Author Comment

by:HLRosenberger
Comment Utility
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
Comment Utility
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
Comment Utility
Agree on the constant.  That was just brain freeze on my part.
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
Comment Utility
thanks.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now