Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# Refresher / Bare Minimums Course Pin
BillWoodruff26-Mar-14 15:21
professionalBillWoodruff26-Mar-14 15:21 
GeneralRe: C# Refresher / Bare Minimums Course Pin
C-P-User-327-Mar-14 1:44
C-P-User-327-Mar-14 1:44 
GeneralRe: C# Refresher / Bare Minimums Course Pin
BobJanova27-Mar-14 7:00
BobJanova27-Mar-14 7:00 
AnswerRe: C# Refresher / Bare Minimums Course Pin
Ravi Bhavnani28-Mar-14 5:17
professionalRavi Bhavnani28-Mar-14 5:17 
GeneralRe: C# Refresher / Bare Minimums Course Pin
C-P-User-329-Mar-14 15:59
C-P-User-329-Mar-14 15:59 
GeneralRe: C# Refresher / Bare Minimums Course Pin
Ravi Bhavnani29-Mar-14 18:07
professionalRavi Bhavnani29-Mar-14 18:07 
GeneralRe: C# Refresher / Bare Minimums Course Pin
C-P-User-331-Mar-14 9:45
C-P-User-331-Mar-14 9:45 
Questioncross thread issue Pin
Member 1068390226-Mar-14 9:22
Member 1068390226-Mar-14 9:22 
Hello I'm new at c# and I'm running into a cross thread issue.

I'm reading ASCII data from the serial port using the following code below:
I will like to know how to pass RxString to a different Method without getting a cross thread error?

Thanks



C#
public void  serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
        {
            try
            {
                RxString = serialPort1.ReadLine();
                label1.Text = RxString;
            }
            catch (Exception)
            {
                MessageBox.Show("Data Receive Error: Close Port & Change Baud Rate" );
                System.Threading.Thread.Sleep(5000);
                bool dataerror = true;
                DataRecError(dataerror);
                return;
            }
            this.Invoke(new EventHandler(DisplayText));
            i++;
        }

AnswerRe: cross thread issue Pin
Richard Andrew x6426-Mar-14 11:22
professionalRichard Andrew x6426-Mar-14 11:22 
GeneralRe: cross thread issue Pin
Member 1068390226-Mar-14 16:50
Member 1068390226-Mar-14 16:50 
AnswerRe: cross thread issue Pin
Bernhard Hiller26-Mar-14 22:04
Bernhard Hiller26-Mar-14 22:04 
GeneralRe: cross thread issue Pin
Member 1068390227-Mar-14 5:51
Member 1068390227-Mar-14 5:51 
GeneralRe: cross thread issue Pin
BobJanova27-Mar-14 6:54
BobJanova27-Mar-14 6:54 
GeneralRe: cross thread issue Pin
Bernhard Hiller27-Mar-14 23:26
Bernhard Hiller27-Mar-14 23:26 
GeneralRe: cross thread issue Pin
BobJanova28-Mar-14 0:26
BobJanova28-Mar-14 0:26 
SuggestionBUILDING a GUI that talks to two energy-meters through the serial port Pin
Henri Aghaei26-Mar-14 7:51
Henri Aghaei26-Mar-14 7:51 
GeneralRe: BUILDING a GUI that talks to two energy-meters through the serial port Pin
Dave Kreskowiak26-Mar-14 8:38
mveDave Kreskowiak26-Mar-14 8:38 
GeneralRe: BUILDING a GUI that talks to two energy-meters through the serial port Pin
V.27-Mar-14 0:04
professionalV.27-Mar-14 0:04 
GeneralRe: BUILDING a GUI that talks to two energy-meters through the serial port Pin
BobJanova27-Mar-14 6:53
BobJanova27-Mar-14 6:53 
GeneralRe: BUILDING a GUI that talks to two energy-meters through the serial port Pin
Henri Aghaei7-Apr-14 9:18
Henri Aghaei7-Apr-14 9:18 
QuestionConvert .mp3 file to .vox in vb.net or c# Pin
Member 1070135326-Mar-14 6:46
Member 1070135326-Mar-14 6:46 
AnswerRe: Convert .mp3 file to .vox in vb.net or c# Pin
Eddy Vluggen26-Mar-14 8:02
professionalEddy Vluggen26-Mar-14 8:02 
GeneralRe: Convert .mp3 file to .vox in vb.net or c# Pin
harold aptroot26-Mar-14 8:26
harold aptroot26-Mar-14 8:26 
QuestionC# Web Forms: Add a context menu to a grid and outside grid also. Pin
AshwiniSH25-Mar-14 23:57
professionalAshwiniSH25-Mar-14 23:57 
AnswerRe: C# Web Forms: Add a context menu to a grid and outside grid also. Pin
Pete O'Hanlon26-Mar-14 0:04
mvePete O'Hanlon26-Mar-14 0:04 

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.