Click here to Skip to main content
15,913,298 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generalshow form2 ........ Pin
Ritesh123413-Jan-05 4:05
Ritesh123413-Jan-05 4:05 
GeneralRe: show form2 ........ Pin
Charlie Williams13-Jan-05 5:51
Charlie Williams13-Jan-05 5:51 
GeneralRe: show form2 ........ Pin
aprx16-Jan-05 0:38
aprx16-Jan-05 0:38 
QuestionBitmap to jpg in memory? Pin
[DK]KiloDunse12-Jan-05 23:55
[DK]KiloDunse12-Jan-05 23:55 
AnswerRe: Bitmap to jpg in memory? Pin
Ritesh123413-Jan-05 3:23
Ritesh123413-Jan-05 3:23 
GeneralRe: Bitmap to jpg in memory? Pin
[DK]KiloDunse13-Jan-05 3:35
[DK]KiloDunse13-Jan-05 3:35 
GeneralWWW to file Pin
paanoik12-Jan-05 23:05
paanoik12-Jan-05 23:05 
GeneralStopping a list of threads Pin
Rizwan Bashir12-Jan-05 22:50
Rizwan Bashir12-Jan-05 22:50 
Hello there
I have created one windows application which works like windows explorer. while browsing the folders in application when user opens any file like any text file . I create one thread for that(can open more then one file at the same time so cannot define the list of threads ). and when user close the application , the application do not stop due to the running thread(s) I kept a global array of threads but from there I can do every thing except stopping the thread.
Global array ::::: because user can open more then one files togather or one by one.

Can any one help me in this issue ????? to get the list of threads on one particular form and ability to close them or break them (so that user can keep working on text file even the application is closed)

The Code is
'Form Level Declaration
Dim th() As Thread

' Event Level... where Thread is created
Dim t As New Thread(AddressOf DisplayFile)
t.Start()
th(th.Length - 1) = t
ReDim Preserve th(th.Length + 1)

' On form Closing event

Dim count As Integer
For count = 0 To th.Length - 1
If Not th(count) Is Nothing Then
If th(count).ThreadState = ThreadState.Running Then
th(count).Abort()
th(count) = Nothing
End If
End If
Next


Rizwan Bashir
GeneralRe: Stopping a list of threads Pin
MohammadAmiry12-Jan-05 23:29
MohammadAmiry12-Jan-05 23:29 
GeneralRe: Stopping a list of threads Pin
Rizwan Bashir12-Jan-05 23:43
Rizwan Bashir12-Jan-05 23:43 
GeneralRe: Stopping a list of threads Pin
Robert Rohde13-Jan-05 9:47
Robert Rohde13-Jan-05 9:47 
GeneralRe: Stopping a list of threads Pin
Rizwan Bashir13-Jan-05 20:11
Rizwan Bashir13-Jan-05 20:11 
Generala?how to conect oracle and dotnet Pin
san_12-Jan-05 18:46
san_12-Jan-05 18:46 
GeneralRe: a?how to conect oracle and dotnet Pin
Dave Kreskowiak13-Jan-05 2:12
mveDave Kreskowiak13-Jan-05 2:12 
Generaldatarow Pin
besah12-Jan-05 15:02
besah12-Jan-05 15:02 
GeneralRe: datarow Pin
Ritesh123413-Jan-05 3:28
Ritesh123413-Jan-05 3:28 
QuestionHow to format field value in crystal report Pin
viettho12-Jan-05 13:16
viettho12-Jan-05 13:16 
AnswerRe: How to format field value in crystal report Pin
Bad Sector12-Jan-05 19:01
Bad Sector12-Jan-05 19:01 
GeneralRe: How to format field value in crystal report Pin
viettho14-Jan-05 7:20
viettho14-Jan-05 7:20 
GeneralExcel Pin
Britnt712-Jan-05 9:23
Britnt712-Jan-05 9:23 
GeneralRe: Excel Pin
Dave Kreskowiak12-Jan-05 12:02
mveDave Kreskowiak12-Jan-05 12:02 
GeneralRe: Excel Pin
Ritesh123413-Jan-05 3:42
Ritesh123413-Jan-05 3:42 
GeneralRe: Excel Pin
Britnt713-Jan-05 4:20
Britnt713-Jan-05 4:20 
GeneralRe: Excel Pin
Ritesh123413-Jan-05 3:47
Ritesh123413-Jan-05 3:47 
GeneralPopulating grid with months of a year Pin
Paps212-Jan-05 7:45
Paps212-Jan-05 7:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.