How to stop "image trail" of a form?

Jaymond Flurrie

Well-known Member
Joined
Sep 22, 2008
Messages
921
Office Version
  1. 365
Platform
  1. Windows
First of all, I have absolutely no idea of the correct term for this. I would need some kind of screen updating function to implement this.

So I open Excel, it opens a form like I want. But now when I use the title bar of my form to drag it around, it leaves "trail" about where the form was, like Windows does when something freezes. The result is pretty much the same than when you complete a solitaire game and those cards "jumps" down from their stacks. leaving a trail behind.

The thing I'd like to get would be that the trail is somehow removed. I tried:

Code:
Private Sub UserForm_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    Application.ScreenUpdating = False
End Sub

Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    Application.ScreenUpdating = True
End Sub

but this only works when I click the form inside, but not clicking the title bar (which is naturally the critical part, since that's the part used for dragging and dropping).

I could imagine I'm not the first one with this problem.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Yes, I have had that problem before. The solution was to ensure that ScreenUpdating was ON the whole time the form was displayed?
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,159
Members
452,892
Latest member
yadavagiri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top