Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh a GUI 2

Status
Not open for further replies.

PrgrmsAll

Programmer
Apr 8, 2003
180
US
Hello:
I have a GUI with a listbox and some other objects, including an image control containing a JPEG. The contents of the list box change based on the navigation of a recordset that is being processed one row after another (850 in all). The problem is, I seem to need a Form1.Refresh to get the listbox to show the refreshed contents based on the current recordset position. Unfortunately this refreshes the screen 850 times which is rather unsightly, especially with the graphic. Any ideas?

Also, how can I make my form always be on top?
 
doesn't listbox.refresh work for you to refresh the contents of the listbox?

Sorry I don't have the easy form on top answer. I purchased a control called FastForm which resizes things for me and can keep a form on top. I'm sure someone will post code which will do that for you.
 
You can set the form to be on top by using the win32 API function "SetWindowPos" as in:

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST = -1

Private Const SWP_NOMOVE = &H2

Private Const SWP_NOSIZE = &H1

SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE

-GS

 
Thank you both for these very good posts. Both worked brilliantly. Much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top