Click to See Complete Forum and Search --> : Caption Bar !
WideAwake
Feb 24th, 2002, 12:48 PM
I have a counter updating a certain label on my form. If I move my form as you do normally using the caption bar at the top of the form all label updaing is stopped e.t.c. whilst the movement is occuring, until I stop, then it carries on.
Does anyone know a way around this, I suppose I need a type of 'DoEvents' for when the caption bar is pressed (mouse down) or something.
Anyone?
TIA
Hack
Feb 24th, 2002, 01:25 PM
You should have a DoEvents in your loop anyway, but that isn't going to help in your present situation.
If you don't want your counter interuppted, then you should prevent the window from being moved while the operation is going on.
There are a number of ways of doing this. My first suggestion would be to freeze the mouse when the operation starts, and return mouse control to the user when the operation ends.
Shawn N
Feb 24th, 2002, 02:01 PM
I'm almost positive this has something to do with Windows taking over the thread whenever it (Windows) does something with your form. Same thing happens when a menu is show, too.
WideAwake
Feb 24th, 2002, 03:23 PM
Hack: "You should have a DoEvents in your loop anyway"
What makes you think I haven't ?
Hack
Feb 24th, 2002, 07:18 PM
Because, in your first post you said "I suppose I need a type of 'DoEvents'", so I figured you didn't have one yet.
My bad if you did/do. Sorry for leaping to an inaccurate conclusion. :)
WideAwake
Feb 25th, 2002, 04:01 AM
Yes I do have a 'DoEvents' in my loop. What I meant was to try to capture when the caption bar had a mouse down event (if that's possible) and put the equivilent of a 'DoEvents' in it so it doesn't freeze the form controls updating whilst mouse down event.
Hack
Feb 25th, 2002, 06:21 AM
I've tried a wide variety of things, but everytime I hold the mouse down on the caption bar, everything stops. I've not found a way around that.
axion_sa
Feb 25th, 2002, 06:33 AM
there's an option under settings | display | effects called "show window contents while dragging".
if it's unchecked, ur form will stop painting itself until the drag is complete.
just a wild though, but could it be that?
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.