any one now how can i free DoEvent Stack (clear empty ..stop )
i tray lackwindowsUpdate and me.visible=false its working but not 4 me
thanks
any one now how can i free DoEvent Stack (clear empty ..stop )
i tray lackwindowsUpdate and me.visible=false its working but not 4 me
thanks
I'm sorry but I don't understand. Do you mean DoEvents? And what is the DoEvent stack?
Do not worry about your difficulties in Mathematics. I can assure you mine are still greater.Tips, Examples & Tutorials:
Albert Einstein
A valuable forum tool Generate unique TreeView keys TreeView with "open" and "closed folder" icons Time code using GetTickCount How to trap the Tab key Scroll a form NumberBox ActiveX control Color a ListView row An InputBox form How to use SaveSetting and GetSetting A program registration scheme Spellcheck a Textbox Resize controls Open Windows Explorer at Last Visited Path A Blackjack Game Count lines of code Private Message Viewer Copy/Paste VB Code Paste VB Code Add-In Insert Procedure Names Add-In A calculator for the game of Spider My review of REALbasic 2008 VB6 Debug Tutorial Picture/Video Viewer VBF Photo Contest Winners
2009 - 2013
yes DoEvents![]()
let say im runing a loop for 1 day lol
now i click on a button on the Form whan the loop is finsh
it's run
it going to do the event mouse down ? that i did before
or any events that i did ? how can i stop it from doing Events ?
my project dont have any DoEvents()
thanks
Last edited by imosha; Dec 3rd, 2005 at 09:17 PM.
Example
Private WorkInProgress as boolean
Private sub Command1_Click()
WorkInProgress =true
dim X as long
for x=1 to 10000
debug.print time
next
WorkInProgress =false
''''((( free eventes )))
end sub
Private sub Command2_Click()
if WorkInProgress =true the exit sub ' not working
debug.print "Click Whan the loop is runing"
'''''((( i dont like that command 2 will work )))
end sub
Last edited by imosha; Dec 3rd, 2005 at 09:43 PM.
I think I understand what you're looking for. You don't want the user to be able to click any buttons while your program is in the middle of doing work.
There is no quick option that I'm aware of.
But it's not very difficult to handle it in code.
Before you start your loop, set a variable like WorkInProgress=True
Then in your click event just do
If WorkInProgress Then Exit Sub
You can set the enabled property of the buttons to False while your code is running.
WorkInProgress not working
and Enabeld not working
the only way that it will work is if i put DoEvents in the loop
Last edited by imosha; Dec 3rd, 2005 at 09:48 PM.
You don't need it to fire every iteration on the loop, unless each iteration takes very long. You could have it fire every 10 to 1000 iterations.
VB Code:
for x=1 to 10000 if x mod 1000 = 0 then doevents endif
The Events are stack in windows i like 2 delete them after the loop is
finsh how can i find them i dont know and how 2 delete them
and only them?
yes i now it will work but not on my programOriginally Posted by dglienna
i dont have a small loop but if i must i do that
i like 2 free the events all events
I don't understand what you are trying to do. You are running a loop, and you don't want users to click on a button? If you set command1.enabled=false, they won't be able to press the button. If you use DoEvents, it WILL allow them to press the button while your loop is executing.
Please explain exactly what you want to happen.
VB Code:
Private Sub Command1_Click() MsgBox "This app will now run in the background" Form1.Visible = False Do Until x > 1000 Loop Form1.Visible = True End Sub
The Form1.Enabled should do better. This way the user will be able to see the form but can't do anything on it.Originally Posted by Jmacp
Pradeep![]()
Pradeep, Microsoft MVP (Visual Basic)
Please appreciate posts that have helped you by clickingicon on the left of the post.
![]()
"A problem well stated is a problem half solved." Charles F. Kettering
Read articles on My Blog 101 LINQ Samples JSON Validator XML Schema Validator "How Do I" videos on MSDN VB.NET and C# Comparison Good Coding Practices VBForums Reputation Saver String Enum Super Simple Tetris Game
![]()
![]()
NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...
Good answer. Yes, set form1.enabled = false and then form1.enabled = true when you are done with your loop.Originally Posted by Pradeep1210
it's not the best
what u need 2 do if this what u like is 2 put a contener Like a picbox and set him 2 false and not the form.
but what i was asking is that i like 2 free the event stack in windows
that it will do the last event only
but i think i must stay whit that
thank you all 4 helping me
you are the best
this is the code
pic.enabeld= false
for I= 1 to 10000
if I mod 200 = 0 then doevents (or down)
debug.print Time
next I
(or up) doevents
pic.enabeld=true
end sub
sorry abut my english i cant read or right well
http://msdn.microsoft.com/library/de...dowshookex.asp
this is a defrant way 2 do that didnt test it yet
Last edited by imosha; Dec 4th, 2005 at 06:42 PM.