Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default userform property change race

I have a msforms.listbox on a userform and I wrote code to sort rows of the
list by column when I click a column heading. There are a few problems that
I found by googling such as column headers are broken and they must be
created with labels on top of the list box but my code works. For a large
table of several thousand rows I want to tell the user to "Wait" by changing
the caption of a label on the form and then sorting but I found that the
caption changes after the sort completes rather than before. I have code
lines to change the caption and call my sort function consecutively. If I
single step the lines the caption changes first but when I execute normally
the caption changes last.

My hypothesis is that underneath the hood there must be Windows message
passing going on and it looses a race to the start of my sort function which
presumably dominates the interpreter unit it completes. How can I insure
that the label caption will change first?

LA


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default userform property change race

Have you tried refreshing the form (using Me.Repaint) after changing the
label ?

Tim


"Luke Alcatel" wrote in message
...
I have a msforms.listbox on a userform and I wrote code to sort rows of the
list by column when I click a column heading. There are a few problems
that
I found by googling such as column headers are broken and they must be
created with labels on top of the list box but my code works. For a large
table of several thousand rows I want to tell the user to "Wait" by
changing
the caption of a label on the form and then sorting but I found that the
caption changes after the sort completes rather than before. I have code
lines to change the caption and call my sort function consecutively. If I
single step the lines the caption changes first but when I execute
normally
the caption changes last.

My hypothesis is that underneath the hood there must be Windows message
passing going on and it looses a race to the start of my sort function
which
presumably dominates the interpreter unit it completes. How can I insure
that the label caption will change first?

LA




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default userform property change race

Thanks - that works. I had not known of the repaint function.

"Tim Williams" <timjwilliams at gmail dot com wrote in message
...
Have you tried refreshing the form (using Me.Repaint) after changing the
label ?

Tim


"Luke Alcatel" wrote in message
...
I have a msforms.listbox on a userform and I wrote code to sort rows of

the
list by column when I click a column heading. There are a few problems
that
I found by googling such as column headers are broken and they must be
created with labels on top of the list box but my code works. For a

large
table of several thousand rows I want to tell the user to "Wait" by
changing
the caption of a label on the form and then sorting but I found that the
caption changes after the sort completes rather than before. I have

code
lines to change the caption and call my sort function consecutively. If

I
single step the lines the caption changes first but when I execute
normally
the caption changes last.

My hypothesis is that underneath the hood there must be Windows message
passing going on and it looses a race to the start of my sort function
which
presumably dominates the interpreter unit it completes. How can I

insure
that the label caption will change first?

LA






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid Property Value error in UserForm combo box Dale Fye Excel Programming 6 October 16th 07 12:58 PM
userform Enabled property behavior changes between excel 97 and 2000/3 Nicholas Dreyer Excel Programming 2 September 20th 06 05:01 AM
'On change' property matpj[_66_] Excel Programming 4 May 16th 06 02:23 PM
Change insidewidth property M Selvaraj Charts and Charting in Excel 1 April 23rd 06 01:07 PM
Userform and controls locked property D.S.[_3_] Excel Programming 3 November 28th 03 03:00 PM


All times are GMT +1. The time now is 06:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"