Ok, I'm in a long-running loop, and I want to give the user a bit of information about how we're progressing. And I want to do this in a form's titlebar.
Ok, easy enough, Me.Caption = "whatever" allows me to change it. And Me.Refresh makes sure it shows.
But Me.Refresh is overkill. I did the following, but I just want to check with others to make sure my thinking is correct:
Thanks,
Elroy
Ok, easy enough, Me.Caption = "whatever" allows me to change it. And Me.Refresh makes sure it shows.
But Me.Refresh is overkill. I did the following, but I just want to check with others to make sure my thinking is correct:
Code:
Option Explicit
Private Declare Function SendMessageW Lib "user32" (ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long
Private Sub Form_Click()
Const WM_NCPAINT As Long = &H85&
Do
Me.Caption = "whatever"
SendMessageW Me.hWnd, WM_NCPAINT, 0&, 0&
' ... do stuff, eventually exiting the loop.
Loop
End Sub
Elroy