Solved

WS_CHILD window

Posted on 2016-09-20
14
47 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
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 33

Expert Comment

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

-saige-
0
 
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Icons and Colors for Terms 3 24
How can I use SQL Stored Procedure to return FedEx Zone 17 41
VB.net/WinForms: adjust Screen Resolution 6 40
Angular JS Route 3 45
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…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

914 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

19 Experts available now in Live!

Get 1:1 Help Now