troubleshooting Question

Paint/Redraw window while dragging

Avatar of HLRosenberger
HLRosenbergerFlag for United States of America asked on
.NET ProgrammingWindows 7Windows OSVisual C++.NETVisual Basic Classic
16 Comments1 Solution280 ViewsLast Modified:
How do I get a window (form) to redraw as it's being dragged?  The form in question is set to always be on top.  This is a class that  inherits "Form".   Here the code that sets the style and exstyle for the window:

Protected Overrides ReadOnly Property CreateParams As System.Windows.Forms.CreateParams

            Const WS_SIZEBOX As Integer = &H40000
            Const WS_EX_TOOLWINDOW As Integer = &H80
            Const WS_EX_NOACTIVATE As Integer = &H8000000
            Const WS_EX_TOPMOST As Integer = &H8

            Dim params As CreateParams = MyBase.CreateParams
            params.Style = params.Style And (Not WS_SIZEBOX)
            params.ExStyle = params.ExStyle Or WS_EX_NOACTIVATE Or WS_EX_TOOLWINDOW Or WS_EX_TOPMOST
            Return params

        End Get
    End Property
Freelance programmer / Consultant

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 16 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros