Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

WS_CHILD window

Posted on 2016-09-20
14
Medium Priority
?
73 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 45

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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
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 45

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 45

Accepted Solution

by:
AndyAinscow earned 2000 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 45

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 45

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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

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…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

636 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