473,396 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Windows Form - Multi-thread Question

Hi.

I am building a basic Windows forms application that has to synchronize
some databases. I want to make the synchronization functions run on a
separate thread than the main form so the user can still have control
of the form.
This is how I am thinking about doing it. The main object that does the
work will be created and run on a separate thread from the main form,
then fire events that will be raised in the form. Just wondering if
this is a safe way to do it.

This is a subset of the form code.

Imports System.Threading

Public Class frmMain
Inherits System.Windows.Forms.Form

Private m_tSynchronization As System.Threading.Thread
Private WithEvents m_objController As DataSynchController.Controller

Private Sub m_objController_Complete(ByVal objSynchType As
DataSynchController.Controller.SynchronizationType ) Handles
m_objController.Complete
MessageBox.Show("Complete:" & objSynchType.ToString)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
m_tSynchronization = New System.Threading.Thread(New
System.Threading.ThreadStart(AddressOf m_objController.Start))
m_tSynchronization.Start()
End Sub

end class
Thanks

Jay MacDonald

Apr 30 '06 #1
0 872

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jim Seymour | last post by:
I have a contact form that uses PHP's mail() function. It recently came to my attention that (some?) MS-Windows mail servers may not properly process data given to the mail() function that's only...
1
by: Doug Helm | last post by:
I should have been more clear in my subject line. I was also the poster in the "File Uploads" topic. I'm not having any luck getting file uploads to work (multi-part HTML form) on a Windows...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
1
by: Wade Beasley | last post by:
I have developed a Windows Forms application with C#. On the windows form I have a master list box with the names of people the user can select from and when selected it calls a Select in SQL...
2
by: Les Peabody | last post by:
Hello. I'm a rookie ASP VBScripter and am having a difficult time scripting the following scenario: I have an index.asp file that has a multi-line text box and a button of type button. When...
0
by: Franklin M. Gauer III | last post by:
Hi, We have an application running that uses FULL SCREEN ANCHORING in Windows Forms. The application runs fine on all of our desktops and some laptops. We are having problems with certain Dell...
1
by: RedJoy | last post by:
I have inherited a huge multi project VS2003 .NET solution: Two of the projects call the same dialog boxes but have differences within the classes. For maintainability and future conversion to...
5
by: Olly | last post by:
Hello Everyone! Could someone please have a look at my JS Form I posted below....Something wrong there, but I don't understand what's exactly. Many thanks. Olly ...
28
by: | last post by:
I have a multi threaded windows form application that runs great after calling Application.Run(). Application.Run is required for a COM component I a using in the app (required for message loop). ...
2
by: deccio | last post by:
I have create an activex Control with Visual studio 2005 and framework 2.0 in c# to add drag & drop functionality to upload multi file. When I use it in a windows form it work fine. Infact if I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.