Click here to Skip to main content
15,921,841 members
Home / Discussions / C#
   

C#

 
Questionarraylist as datagrid source [modified] Pin
The Onslaught31-Oct-07 8:20
The Onslaught31-Oct-07 8:20 
AnswerRe: arraylist as datagrid source Pin
eggsovereasy31-Oct-07 9:00
eggsovereasy31-Oct-07 9:00 
GeneralRe: arraylist as datagrid source Pin
The Onslaught1-Nov-07 6:48
The Onslaught1-Nov-07 6:48 
QuestionGuarantee MainForm Focus on Startup Pin
Sukhjinder_K31-Oct-07 8:19
Sukhjinder_K31-Oct-07 8:19 
AnswerRe: Guarantee MainForm Focus on Startup Pin
Judah Gabriel Himango31-Oct-07 8:19
sponsorJudah Gabriel Himango31-Oct-07 8:19 
Questionhow to turn a datatabel on sql interrogation ? Pin
eraydeniz31-Oct-07 8:04
eraydeniz31-Oct-07 8:04 
AnswerRe: how to turn a datatabel on sql interrogation ? Pin
pmarfleet31-Oct-07 8:20
pmarfleet31-Oct-07 8:20 
Questionwhy does my meesage box take attention twice? Pin
gizmokaka31-Oct-07 6:39
gizmokaka31-Oct-07 6:39 
Hello to all.

I guess I don't really understand how things(especially threads).

I have a function that runs in a separate thread then the rest of my application.

in the end of the function I print to a messageBox info I need for debugging.

the problem is I get to the messageBox twice.

the function is:

private void checkProblematicValves()
        {
            int dCount = 0;
            int numMessagesLost = 0;
            if (valveCheckedListBox.InvokeRequired)
                {
                    checkProblematicValvesHendler d = new checkProblematicValvesHendler(checkProblematicValves);
                    valveCheckedListBox.Invoke(d);
                }    
            else
            {
                foreach (long key in messageArr.Keys)
                {
                    if (messageArr[key] != null)
                    {


                        doing some stuff here!!!!!!!!!!!!!!

                            
                    }
                }
            }
            MessageBox.Show(numMessagesLost.ToString());
        }


I get to this "MessageBox.Show(numMessagesLost.ToString());" line twice, once with a true value
that prints to messageBox and right after I return to the same spot and it prints 0;

Can any one explain to me how come????

thanks in advanced.
AnswerRe: why does my meesage box take attention twice? Pin
gizmokaka31-Oct-07 6:49
gizmokaka31-Oct-07 6:49 
GeneralRe: why does my meesage box take attention twice? Pin
Luc Pattyn31-Oct-07 7:05
sitebuilderLuc Pattyn31-Oct-07 7:05 
QuestionSemaphore-like sync mechanism beetween multiple computers Pin
SGAYET31-Oct-07 6:31
SGAYET31-Oct-07 6:31 
AnswerRe: Semaphore-like sync mechanism beetween multiple computers Pin
led mike31-Oct-07 7:16
led mike31-Oct-07 7:16 
GeneralRe: Semaphore-like sync mechanism beetween multiple computers Pin
SGAYET4-Nov-07 21:21
SGAYET4-Nov-07 21:21 
GeneralRe: Semaphore-like sync mechanism beetween multiple computers Pin
led mike5-Nov-07 6:33
led mike5-Nov-07 6:33 
QuestionIs there a way to access a Form's object by a method? Pin
humblepgmr31-Oct-07 6:25
humblepgmr31-Oct-07 6:25 
AnswerRe: Is there a way to access a Form's object by a method? Pin
pmarfleet31-Oct-07 7:15
pmarfleet31-Oct-07 7:15 
GeneralRe: Is there a way to access a Form's object by a method? Pin
humblepgmr1-Nov-07 6:15
humblepgmr1-Nov-07 6:15 
GeneralRe: Is there a way to access a Form's object by a method? Pin
pmarfleet1-Nov-07 6:27
pmarfleet1-Nov-07 6:27 
QuestionBind data into textbox Pin
zafax_31-Oct-07 6:10
zafax_31-Oct-07 6:10 
AnswerRe: Bind data into textbox Pin
Drew McGhie31-Oct-07 10:04
Drew McGhie31-Oct-07 10:04 
GeneralRe: Bind data into textbox Pin
zafax_31-Oct-07 10:14
zafax_31-Oct-07 10:14 
GeneralRe: Bind data into textbox Pin
Drew McGhie31-Oct-07 10:58
Drew McGhie31-Oct-07 10:58 
QuestionHow to lookup an IP address from a MAC address Pin
r-mo31-Oct-07 5:49
r-mo31-Oct-07 5:49 
AnswerRe: How to lookup an IP address from a MAC address Pin
led mike31-Oct-07 6:00
led mike31-Oct-07 6:00 
GeneralRe: How to lookup an IP address from a MAC address Pin
r-mo31-Oct-07 13:11
r-mo31-Oct-07 13:11 

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.