Go Back   IceInSpace > Equipment > Software and Computers
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread
  #1  
Old 08-06-2009, 09:58 PM
thunderchildobs
Registered User

thunderchildobs is offline
 
Join Date: Dec 2006
Location: Ipswich, Qld, Aust
Posts: 639
Are there any Visual Basic programmers out there?

Are there any Visual Basic programmers out there?

I am looking for some help on threads and GUIs.

Brendan
Reply With Quote
  #2  
Old 09-06-2009, 07:12 AM
sheeny's Avatar
sheeny (Al)
Spam Hunter

sheeny is offline
 
Join Date: Jun 2005
Location: Oberon NSW
Posts: 14,438
I play about with VB.NET 2005 when I have a project to do. I wouldn't say I'm particularly experienced with threads and GUIs though, but that's never stopped me.

Al.
Reply With Quote
  #3  
Old 09-06-2009, 12:23 PM
thunderchildobs
Registered User

thunderchildobs is offline
 
Join Date: Dec 2006
Location: Ipswich, Qld, Aust
Posts: 639
I am trying to do the following.

I have menu item that opens a window with "Start", "Pause", "Abort" buttons, and a text box.

On clicking "Start" the program does the following

AbortOperation = false
I = 1
Loop
I = I + 1
Display I into the text box
Until I > 10000 or AbortOperation = True
End

On clcking the "Abort" button
AbortOperation = true
Display "Aborted"" in the textbox
end

The idea being that Abort Button is to stop the processing.
If I click "Abort" nothing happens immediatley,
but the "Aborted" message is displayed when the loop finished.

It seems the Abort click is being queue somewhere and not imediataley interrupting the loop.

Any suggestions.

I am using VB 2005.

thanks
Reply With Quote
  #4  
Old 09-06-2009, 12:49 PM
sadia
Registered User

sadia is offline
 
Join Date: Mar 2009
Location: melbourne
Posts: 287
You need to make the application multithread compatible. Its gonna be kinda long if I explain it here so i would suggest you google on Multithreading for VB.NET or read any similar article like the following http://www.devx.com/DevX/10MinuteSolution/20365
Reply With Quote
  #5  
Old 09-06-2009, 01:38 PM
vaztr (Andrew)
Registered User

vaztr is offline
 
Join Date: Jun 2006
Location: On a dark hill near the ACT
Posts: 121
You could also try a 'DoEvents' anywhere within your loop - this basically tells your loop to check whats going on with the rest of the PC before continuing on - sort of lets it 'take a breath'. VB loops always seem to hog the processor!!
Reply With Quote
  #6  
Old 09-06-2009, 07:08 PM
thunderchildobs
Registered User

thunderchildobs is offline
 
Join Date: Dec 2006
Location: Ipswich, Qld, Aust
Posts: 639
Thanks for the info.

Vaztr, the DoEvents was answer I was looking for.

Brendan
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time is now 01:00 AM.

Powered by vBulletin Version 3.8.7 | Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Advertisement
Bintel
Advertisement