Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 79
  • Last Modified:

WS_CHILD window

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
HLRosenberger
Asked:
HLRosenberger
  • 8
  • 5
1 Solution
 
AndyAinscowCommented:
>>How can I fix this?

Fix what, it is working correctly.
0
 
HLRosenbergerAuthor Commented:
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
 
it_saigeDeveloperCommented:
Could you provide an example that replicates the issue?

-saige-
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
HLRosenbergerAuthor Commented:
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
 
HLRosenbergerAuthor Commented:
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
 
AndyAinscowCommented:
Ahh, now I understand.  I've seen that happen before, I'll try to think why it behaved that way.
0
 
HLRosenbergerAuthor Commented:
"I've seen that happen before" - you mean the painting issue?
0
 
HLRosenbergerAuthor Commented:
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
 
AndyAinscowCommented:
Have you tried the WS_CLIPSIBLINGS as well as the WS_CHILD property on this window.  That might cure your painting problem.
0
 
AndyAinscowCommented:
ps
Const NO_WS_SIZEBOX As Integer = &HFFFBFFFF
what is that?
0
 
HLRosenbergerAuthor Commented:
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
 
AndyAinscowCommented:
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
 
HLRosenbergerAuthor Commented:
Agree on the constant.  That was just brain freeze on my part.
0
 
HLRosenbergerAuthor Commented:
thanks.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 8
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now