Click here to Skip to main content
15,916,693 members
Home / Discussions / C#
   

C#

 
AnswerRe: Custom item list Pin
Abhinav S26-Dec-09 2:36
Abhinav S26-Dec-09 2:36 
AnswerRe: Custom item list Pin
Jimmanuel26-Dec-09 2:40
Jimmanuel26-Dec-09 2:40 
AnswerRe: Custom item list Pin
Luc Pattyn26-Dec-09 3:02
sitebuilderLuc Pattyn26-Dec-09 3:02 
GeneralRe: Custom item list Pin
Zaegra26-Dec-09 3:18
Zaegra26-Dec-09 3:18 
QuestionDelete Drawed Shape Pin
dataminers25-Dec-09 23:34
dataminers25-Dec-09 23:34 
AnswerRe: Delete Drawed Shape Pin
Luc Pattyn26-Dec-09 1:47
sitebuilderLuc Pattyn26-Dec-09 1:47 
GeneralRe: Delete Drawed Shape Pin
dataminers29-Dec-09 22:38
dataminers29-Dec-09 22:38 
GeneralRe: Delete Drawed Shape Pin
Luc Pattyn30-Dec-09 0:33
sitebuilderLuc Pattyn30-Dec-09 0:33 
Questionunsafe Pin
sanforjackass25-Dec-09 22:38
sanforjackass25-Dec-09 22:38 
AnswerRe: unsafe Pin
dan!sh 25-Dec-09 22:44
professional dan!sh 25-Dec-09 22:44 
GeneralRe: unsafe Pin
sanforjackass25-Dec-09 22:53
sanforjackass25-Dec-09 22:53 
GeneralRe: unsafe Pin
dan!sh 25-Dec-09 23:00
professional dan!sh 25-Dec-09 23:00 
GeneralRe: unsafe Pin
sanforjackass25-Dec-09 23:44
sanforjackass25-Dec-09 23:44 
Questiontypes formats in app.config Pin
Hussam Fattahi25-Dec-09 22:21
Hussam Fattahi25-Dec-09 22:21 
AnswerRe: types formats in app.config Pin
dan!sh 25-Dec-09 22:42
professional dan!sh 25-Dec-09 22:42 
QuestionAborting a Thread. Pin
Ronni Marker25-Dec-09 22:12
Ronni Marker25-Dec-09 22:12 
Hi I have the following code that is updating an dropdown box with information Active Directory information - this below will show Domain Controllers btw.

But I am trying unsuccessfully to cancel an existing running thread if one exist already. this is mainly because sometimes a thread can be running indefinitely and need to abort that, or if another thread is called that need to update the same dropdownbox. Anyway are there any out here who could explain how I could abort an running thread?

private void ThreadDC()
{

    Thread TRDomainC = new Thread(ThreadingDC);
    if (TRDomainC.IsAlive)
    {
        TRDomainC.Abort();
    }
    TRDomainC.SetApartmentState(ApartmentState.STA);
    TRDomainC.Start();
}

private void ThreadingDC()
{
    comboBox1.Items.Clear();
    try
    {
        if (comboBoxDomains.SelectedIndex >= 0 && comboBoxDomains.SelectedIndex != -1)
        {
            foreach (string dc in domainInfoComponent[comboBoxDomains.SelectedItem.ToString()])
            {
                comboBox1.Items.Add(dc);
            }
            lastIndex = comboBoxDomains.SelectedIndex;
            comboBox1.SelectedIndex = 0;
        }
    }
    catch
    {
        lastIndex = 0;
        comboBox1.SelectedIndex = -1;
    }
}

AnswerRe: Aborting a Thread. Pin
Nicholas Butler25-Dec-09 22:46
sitebuilderNicholas Butler25-Dec-09 22:46 
GeneralRe: Aborting a Thread. Pin
Ronni Marker26-Dec-09 2:30
Ronni Marker26-Dec-09 2:30 
AnswerRe: Aborting a Thread. Pin
Luc Pattyn26-Dec-09 1:50
sitebuilderLuc Pattyn26-Dec-09 1:50 
GeneralRe: Aborting a Thread. Pin
Ronni Marker26-Dec-09 2:32
Ronni Marker26-Dec-09 2:32 
GeneralRe: Aborting a Thread. Pin
Luc Pattyn26-Dec-09 3:00
sitebuilderLuc Pattyn26-Dec-09 3:00 
QuestionOpen picture from application and edit with default picture edit application ? Pin
Yanshof25-Dec-09 10:27
Yanshof25-Dec-09 10:27 
AnswerRe: Open picture from application and edit with default picture edit application ? Pin
Luc Pattyn25-Dec-09 11:21
sitebuilderLuc Pattyn25-Dec-09 11:21 
Questionvisual studio and UML diagrams and unit testing Pin
Ryan Minor25-Dec-09 5:46
Ryan Minor25-Dec-09 5:46 
AnswerRe: visual studio and UML diagrams and unit testing Pin
Dimitri Witkowski25-Dec-09 12:20
Dimitri Witkowski25-Dec-09 12:20 

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.