Click here to Skip to main content
16,005,080 members
Home / Discussions / C#
   

C#

 
GeneralRe: To know which file was opened by an application. Pin
yjoo93172-Feb-06 11:26
yjoo93172-Feb-06 11:26 
GeneralRe: To know which file was opened by an application. Pin
Dave Kreskowiak2-Feb-06 15:40
mveDave Kreskowiak2-Feb-06 15:40 
QuestionValidation of WinForm Data Pin
Wayne Phipps2-Feb-06 9:51
Wayne Phipps2-Feb-06 9:51 
QuestionPixel size of frame and control changed Pin
xjsun2-Feb-06 9:35
xjsun2-Feb-06 9:35 
AnswerRe: Pixel size of frame and control changed Pin
malharone2-Feb-06 11:15
malharone2-Feb-06 11:15 
GeneralRe: Pixel size of frame and control changed Pin
xjsun7-Feb-06 8:09
xjsun7-Feb-06 8:09 
GeneralRe: Pixel size of frame and control changed Pin
malharone7-Feb-06 8:11
malharone7-Feb-06 8:11 
Questionthread safe calls Pin
Manu_812-Feb-06 8:37
Manu_812-Feb-06 8:37 
Hi,
I posted this message earlier and some one posted a link to an article. It helped, but still I am confused how to do it in my scenario.
I have a HomeForm (main form which has main()). In one of its meathod I have
<br />
PrimeInfoThread pTh = new PrimeInfoThread(this.pictureBox1,this.panel4,this.button1,this.button3,this.SLabel);<br />
Thread t = new Thread(new ThreadStart(pTh.ThreadProc));<br />
t.Start();


PrimeInfoThread is another class as follows
public class PrimeInfoThread<br />
	{<br />
		private System.Windows.Forms.PictureBox hPic ;<br />
		private System.Windows.Forms.Panel hPan ;<br />
		private System.Windows.Forms.Button but1 ;<br />
		private System.Windows.Forms.Button but2 ;<br />
		private System.Windows.Forms.Label slab ;<br />
<br />
		// The constructor <br />
		public PrimeInfoThread(System.Windows.Forms.PictureBox hP,<br />
								System.Windows.Forms.Panel hpanel,<br />
								System.Windows.Forms.Button b1,<br />
								System.Windows.Forms.Button b2,<br />
								System.Windows.Forms.Label Sl) <br />
		{<br />
			hPic = hP;<br />
			hPan = hpanel;<br />
			but1 = b1;<br />
			but2 = b2;<br />
			slab = Sl;<br />
		}<br />
<br />
		public void ThreadProc() <br />
		{<br />
			EnumGetEDID InitEnumObj = new EnumGetEDID();<br />
			InitEnumObj.AppInitEnum(slab);	<br />
			hPic.Hide();<br />
			hPan.Hide();<br />
			but1.Show();<br />
			but2.Show();<br />
			<br />
		}<br />
<br />
	}


In threadProc I call another class EnumGetEDID and call AppInitEnum(slab) where I pass the label. Inside AppInitEnum() I do 'slab.Text' to set the text values.
Now how do I make this Thread safe. Can anyone show it in my code.
Thanks a lot.
AnswerRe: thread safe calls Pin
kasik2-Feb-06 9:35
kasik2-Feb-06 9:35 
GeneralRe: thread safe calls Pin
eligazit2-Feb-06 10:50
eligazit2-Feb-06 10:50 
GeneralRe: thread safe calls Pin
kasik2-Feb-06 11:01
kasik2-Feb-06 11:01 
GeneralRe: thread safe calls Pin
kasik2-Feb-06 11:19
kasik2-Feb-06 11:19 
GeneralRe: thread safe calls Pin
Dave Kreskowiak2-Feb-06 15:29
mveDave Kreskowiak2-Feb-06 15:29 
GeneralRe: thread safe calls Pin
kasik3-Feb-06 2:26
kasik3-Feb-06 2:26 
GeneralRe: thread safe calls Pin
Dave Kreskowiak3-Feb-06 3:07
mveDave Kreskowiak3-Feb-06 3:07 
GeneralRe: thread safe calls Pin
eligazit2-Feb-06 20:42
eligazit2-Feb-06 20:42 
GeneralRe: thread safe calls Pin
kasik3-Feb-06 2:32
kasik3-Feb-06 2:32 
Questiontransferring vb.net solution to c#.net Pin
kourvoisier2-Feb-06 8:34
kourvoisier2-Feb-06 8:34 
AnswerRe: transferring vb.net solution to c#.net Pin
malharone2-Feb-06 11:19
malharone2-Feb-06 11:19 
GeneralRe: transferring vb.net solution to c#.net Pin
kourvoisier2-Feb-06 11:20
kourvoisier2-Feb-06 11:20 
GeneralRe: transferring vb.net solution to c#.net Pin
malharone2-Feb-06 11:41
malharone2-Feb-06 11:41 
Questioncreating a truly transparent control Pin
melanieab2-Feb-06 7:58
melanieab2-Feb-06 7:58 
QuestionRe: creating a truly transparent control Pin
melanieab2-Feb-06 8:34
melanieab2-Feb-06 8:34 
AnswerRe: creating a truly transparent control Pin
microsoc2-Feb-06 21:15
microsoc2-Feb-06 21:15 
QuestionInserting a record and retrieving recordid Pin
moazzamahmed2-Feb-06 7:00
moazzamahmed2-Feb-06 7:00 

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.