I have written a Macro which launches a dialog where the user selects a value from a combo box. Unfortunately the dialog box shows and I get an hourglass for between 1 and 20 seconds.
There are a couple of workaronds I have found which seem to help:
- A quick CTRL-Alt-Del followed by Escape.
- Clicking on the spinning macro animation in the task bar.
- Minimising and then maximising the dialog from the taskbar.
However this is getting to be a real pain, does anyone know what is going on to cause this and how I can prevent the hanging?
The code I am using to launch the dialog is
Dim winptr As New WinWrapper()
frm.ShowDialog(winptr)
and
'' This class is used to set the proper parent to any UI that you may display from within a macro.
Public Class WinWrapper
Implements System.Windows.Forms.IWin32Window
Overridable ReadOnly Property Handle() As System.IntPtr Implements System.Windows.Forms.IWin32Window.Handle
Get
Dim iptr As New System.IntPtr(DTE.MainWindow.HWnd)
Return iptr
End Get
End Property
End Class