Click here to Skip to main content
15,939,853 members
Home / Discussions / C#
   

C#

 
AnswerRe: Button.Text has no effect? Pin
Dave Kreskowiak3-May-07 4:53
mveDave Kreskowiak3-May-07 4:53 
GeneralRe: Button.Text has no effect? Pin
Sandeep Akhare3-May-07 5:08
Sandeep Akhare3-May-07 5:08 
GeneralRe: Button.Text has no effect? Pin
Dave Kreskowiak3-May-07 5:35
mveDave Kreskowiak3-May-07 5:35 
GeneralRe: Button.Text has no effect? Pin
User 66583-May-07 6:13
User 66583-May-07 6:13 
GeneralRe: Button.Text has no effect? Pin
Dave Kreskowiak3-May-07 6:57
mveDave Kreskowiak3-May-07 6:57 
AnswerRe: Button.Text has no effect? Pin
MoustafaS3-May-07 6:15
MoustafaS3-May-07 6:15 
AnswerRe: Button.Text has no effect? Pin
Stefan Prodan3-May-07 12:05
Stefan Prodan3-May-07 12:05 
QuestionConcept of Thread.BeginCriticalRegion() Pin
Sandeep Akhare3-May-07 4:28
Sandeep Akhare3-May-07 4:28 
HI All
I am confused while using Thread.BeginCriticalRegion(); in my application
what i am trying after compliting specific task by thread i have to abort same thread by calling abort method see the code
<br />
<br />
  private void button3_Click(object sender, EventArgs e)<br />
        {<br />
            ParameterizedThreadStart paramThreadDelagate = new ParameterizedThreadStart(WorkWithParameter);<br />
            Thread thread = new Thread(paramThreadDelagate);<br />
            thread.Start();<br />
            Thread.Sleep(1000);  <br />
            thread.Abort();<br />
            MessageBox.Show("Aborted");<br />
        }<br />
<br />
<br />
<br />
<br />
<br />
private void WorkWithParameter()<br />
 {<br />
       <br />
                Thread.BeginCriticalRegion();<br />
                MessageBox.Show("1");<br />
                MessageBox.Show("2");<br />
                MessageBox.Show("3");<br />
                MessageBox.Show("4");<br />
                MessageBox.Show("5");<br />
                Thread.EndCriticalRegion();<br />
 }<br />
<br />

The idea behind the critical region is to provide a region of code that must be executed as if it were a single statement. Any attempt to abort a thread while a critical region will have to wait until after the critical region is compplite .so the problem is i am getting message Aborted instead of executing whole WorkWithParameter method. Can any one help me out ?



Thanks and Regards
Sandeep

If you want something you never had,
do something you have never done!


AnswerRe: Concept of Thread.BeginCriticalRegion() Pin
Jimmanuel3-May-07 5:42
Jimmanuel3-May-07 5:42 
GeneralRe: Concept of Thread.BeginCriticalRegion() Pin
Sandeep Akhare3-May-07 19:55
Sandeep Akhare3-May-07 19:55 
GeneralRe: Concept of Thread.BeginCriticalRegion() Pin
Jimmanuel4-May-07 3:26
Jimmanuel4-May-07 3:26 
AnswerRe: Concept of Thread.BeginCriticalRegion() Pin
pbraun3-May-07 8:34
pbraun3-May-07 8:34 
GeneralRe: Concept of Thread.BeginCriticalRegion() Pin
Sandeep Akhare4-May-07 2:32
Sandeep Akhare4-May-07 2:32 
GeneralRe: Concept of Thread.BeginCriticalRegion() Pin
Stefan Prodan3-May-07 12:13
Stefan Prodan3-May-07 12:13 
AnswerRe: Encrtpy a DataTable/DataSet served by a WebService in VS2005/C# Pin
Andre Vianna4-May-07 4:16
Andre Vianna4-May-07 4:16 
QuestionProperties window - when are the properties used? Pin
microslav3-May-07 4:20
microslav3-May-07 4:20 
AnswerRe: Properties window - when are the properties used? Pin
Jon Hulatt3-May-07 4:38
Jon Hulatt3-May-07 4:38 
AnswerRe: Properties window - when are the properties used? Pin
PIEBALDconsult3-May-07 8:07
mvePIEBALDconsult3-May-07 8:07 
QuestionVista-izing my c# 2 app Pin
Jon Hulatt3-May-07 3:56
Jon Hulatt3-May-07 3:56 
AnswerRe: Vista-izing my c# 2 app Pin
Scott Dorman3-May-07 4:59
professionalScott Dorman3-May-07 4:59 
AnswerRe: Vista-izing my c# 2 app Pin
Daniel Grunwald3-May-07 8:35
Daniel Grunwald3-May-07 8:35 
QuestionCopy bitmap to OpenOffice writer via clipboard Pin
frozenpondlife3-May-07 3:28
frozenpondlife3-May-07 3:28 
QuestionCheck 2 rows in different tables Pin
Herman<T>.Instance3-May-07 3:07
Herman<T>.Instance3-May-07 3:07 
AnswerRe: Check 2 rows in different tables Pin
Arun.Immanuel3-May-07 3:28
Arun.Immanuel3-May-07 3:28 
GeneralRe: Check 2 rows in different tables Pin
Herman<T>.Instance3-May-07 23:22
Herman<T>.Instance3-May-07 23:22 

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.