Click here to Skip to main content
15,388,805 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to trigger an event with a COM port? Pin
OriginalGriff13-Apr-22 2:48
mveOriginalGriff13-Apr-22 2:48 
AnswerRe: How to trigger an event with a COM port? Pin
Raphael Adeniji13-Apr-22 11:31
MemberRaphael Adeniji13-Apr-22 11:31 
QuestionNeed help advice Pin
hardsoft11-Apr-22 18:06
Memberhardsoft11-Apr-22 18:06 
AnswerRe: Need help advice Pin
Gerry Schmitz12-Apr-22 4:59
mveGerry Schmitz12-Apr-22 4:59 
GeneralRe: Need help advice Pin
hardsoft12-Apr-22 13:25
Memberhardsoft12-Apr-22 13:25 
GeneralRe: Need help advice Pin
Gerry Schmitz12-Apr-22 13:41
mveGerry Schmitz12-Apr-22 13:41 
GeneralRe: Need help advice Pin
hardsoft12-Apr-22 14:04
Memberhardsoft12-Apr-22 14:04 
QuestionProblem to read Com port with while loop? Pin
Member 1405587911-Apr-22 0:55
MemberMember 1405587911-Apr-22 0:55 
The while loop stop when data reads x, but the buttonTransfer button never gets enabled
and the MessageBox message never shows up, but the program does not either freeze. What can be the problem with this code?


C#
try
{
  buttonTransfer.Enabled = false;
  port = new SerialPort();
  port.BaudRate = 9600;
  port.PortName = getValueNew;
  port.Open();

  port.Write("1");

  while (data != "x")
  {
     data = port.ReadLine();
     this.Invoke(new EventHandler(displaydata_event));
  }
  buttonTransfer.Enabled = true;
  MessageBox.Show("Done!");
  port.Close();
}
catch (Exception ex)
{
   MessageBox.Show(ex.Message);
}

AnswerRe: Problem to read Com port with while loop? Pin
OriginalGriff11-Apr-22 1:28
mveOriginalGriff11-Apr-22 1:28 
AnswerRe: Problem to read Com port with while loop? Pin
Raphael Adeniji11-Apr-22 2:39
MemberRaphael Adeniji11-Apr-22 2:39 
AnswerRe: Problem to read Com port with while loop? Pin
Luc Pattyn11-Apr-22 12:21
sitebuilderLuc Pattyn11-Apr-22 12:21 
QuestionMigrating Web Applications (Web Forms) to Dot Net Core Blazor Applications Pin
Raphael Adeniji10-Apr-22 19:44
MemberRaphael Adeniji10-Apr-22 19:44 
AnswerRe: Migrating Web Applications (Web Forms) to Dot Net Core Blazor Applications Pin
Richard MacCutchan10-Apr-22 21:28
mveRichard MacCutchan10-Apr-22 21:28 
GeneralRe: Migrating Web Applications (Web Forms) to Dot Net Core Blazor Applications Pin
Raphael Adeniji11-Apr-22 2:28
MemberRaphael Adeniji11-Apr-22 2:28 
GeneralRe: Migrating Web Applications (Web Forms) to Dot Net Core Blazor Applications Pin
Richard MacCutchan11-Apr-22 6:06
mveRichard MacCutchan11-Apr-22 6:06 
QuestionWill calling a new method/property work if called on a "base" abstract object Pin
pr1mem0ver9-Apr-22 18:42
Memberpr1mem0ver9-Apr-22 18:42 
AnswerRe: Will calling a new method/property work if called on a "base" abstract object Pin
pr1mem0ver9-Apr-22 20:20
Memberpr1mem0ver9-Apr-22 20:20 
GeneralRe: Will calling a new method/property work if called on a "base" abstract object Pin
OriginalGriff9-Apr-22 22:16
mveOriginalGriff9-Apr-22 22:16 
GeneralRe: Will calling a new method/property work if called on a "base" abstract object Pin
pr1mem0ver10-Apr-22 6:10
Memberpr1mem0ver10-Apr-22 6:10 
QuestionProblem with BackgroundWorker component? Pin
Member 140558797-Apr-22 1:23
MemberMember 140558797-Apr-22 1:23 
AnswerRe: Problem with BackgroundWorker component? Pin
Richard MacCutchan7-Apr-22 1:41
mveRichard MacCutchan7-Apr-22 1:41 
AnswerRe: Problem with BackgroundWorker component? Pin
Luc Pattyn7-Apr-22 6:30
sitebuilderLuc Pattyn7-Apr-22 6:30 
AnswerRe: Problem with BackgroundWorker component? Pin
Gerry Schmitz7-Apr-22 6:30
mveGerry Schmitz7-Apr-22 6:30 
QuestionC# Exception: An object reference does not point to an instance of an objec Pin
Member 155831391-Apr-22 0:29
MemberMember 155831391-Apr-22 0:29 
AnswerRe: C# Exception: An object reference does not point to an instance of an objec Pin
Richard Deeming1-Apr-22 0:51
mveRichard Deeming1-Apr-22 0:51 

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.