HLRosenberger
asked on
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?
ASKER
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.
Could you provide an example that replicates the issue?
-saige-
-saige-
ASKER
I override CreateParms:
Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.Creat eParams
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
Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.Creat
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
ASKER
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.
Ahh, now I understand. I've seen that happen before, I'll try to think why it behaved that way.
ASKER
"I've seen that happen before" - you mean the painting issue?
ASKER
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ps
Const NO_WS_SIZEBOX As Integer = &HFFFBFFFF
what is that?
Const NO_WS_SIZEBOX As Integer = &HFFFBFFFF
what is that?
ASKER
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.
I added WS_CLIPSIBLINGS . That did not help.
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).
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).
ASKER
Agree on the constant. That was just brain freeze on my part.
ASKER
thanks.
Fix what, it is working correctly.