By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,515 Members | 1,061 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,515 IT Pros & Developers. It's quick & easy.

speedin up some apps

P: n/a
Hey this is a dumb question, but I need to speed up an app and having a
brain fart today...

So I have this code, (feel free to use it if you want)

Public Sub LoadForm(ByVal formType As Type, ByVal fParent As Form, Optional
ByVal Singleton As Boolean = True, Optional ByVal Modal As Boolean = False)

Dim cThread As System.Threading.Thread

Dim cTPool As System.Threading.ThreadPool

Dim tForm As System.Windows.Forms.Form

Try

tForm = FormAlreadyExists(fParent, formType)

If (tForm Is Nothing) Then

tForm = Activator.CreateInstance(formType)

If (fParent.IsMdiContainer) Then

tForm.MdiParent = fParent

End If

Else

If (Singleton) Then

tForm.Focus()

Else

tForm = Activator.CreateInstance(formType)

If (fParent.IsMdiContainer) Then

tForm.MdiParent = fParent

End If

End If

End If

If (Modal) Then

tForm.ShowDialog(fParent)

Else

tForm.Show()

End If

Catch ex As Exception

End Try

End Sub

basically, on the "shows" I want to spin them off on an independent thread.
I should be able to just free thread it like VB6 but wondering if someone
had a suggestion as to how to do this the best way. as you can see I was
considering using a thread pool, but thats just not going to work right.

Would appreciate if anyone has anything.

Thanks,

cJ
Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.