Click here to Skip to main content
16,017,351 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to disable other buttons based on user role login Pin
Eddy Vluggen10-Nov-19 8:01
professionalEddy Vluggen10-Nov-19 8:01 
GeneralRe: How to disable other buttons based on user role login Pin
BillWoodruff10-Nov-19 11:06
professionalBillWoodruff10-Nov-19 11:06 
GeneralRe: How to disable other buttons based on user role login Pin
Eddy Vluggen10-Nov-19 11:59
professionalEddy Vluggen10-Nov-19 11:59 
QuestionIs the command to check if the bell is running or stopped ? Pin
Member 24584677-Nov-19 20:55
Member 24584677-Nov-19 20:55 
AnswerRe: Is the command to check if the bell is running or stopped ? Pin
Richard Deeming8-Nov-19 1:39
mveRichard Deeming8-Nov-19 1:39 
GeneralRe: Is the command to check if the bell is running or stopped ? Pin
Member 245846711-Nov-19 17:45
Member 245846711-Nov-19 17:45 
GeneralRe: Is the command to check if the bell is running or stopped ? Pin
Richard Deeming12-Nov-19 0:15
mveRichard Deeming12-Nov-19 0:15 
GeneralRe: Is the command to check if the bell is running or stopped ? Pin
Member 245846712-Nov-19 14:25
Member 245846712-Nov-19 14:25 
I do not know how to use backgroundWorker in my code so the device crashes, I troubleshoot I see Debug.Print("Status: PLAY") and Debug.Print("Status: STOP") appear only once, You see my code, did I write anything wrong ?
C#
bool _isStopped = true;
public Form1()
   {
       InitializeComponent();
       backgroundWorker1.WorkerReportsProgress = true;
       backgroundWorker1.WorkerSupportsCancellation = true;

       lblStatusPlaySound.ForeColor = Color.Violet;
       lblStatusPlaySound.Text = "Status: PLAY/STOP";
   }
private void btnPlaySound_Click(object sender, EventArgs e)
  {
      // Start the asynchronous operation.
      backgroundWorker1.RunWorkerAsync();

      using (SoundPlayer player = new SoundPlayer(Properties.Resources.ring))
      {
          player.Play();
      }

      while (_isStopped == true)
      {      
         if (backgroundWorker1.IsBusy != true)
         { _isStopped = true; }
         else //
         { _isStopped = false; }

         lblStatusPlaySound.ForeColor = Color.Green;
         lblStatusPlaySound.Text = "Status: PLAY";
         lblStatusPlaySound.Refresh(); //                
         Debug.Print("Status: PLAY");
     }

     lblStatusPlaySound.ForeColor = Color.Red;
     lblStatusPlaySound.Text = "Status: STOP";
     lblStatusPlaySound.Refresh();             
     Debug.Print("Status: STOP");

  }

GeneralRe: Is the command to check if the bell is running or stopped ? Pin
Richard Deeming13-Nov-19 1:30
mveRichard Deeming13-Nov-19 1:30 
GeneralRe: Is the command to check if the bell is running or stopped ? Pin
Member 245846713-Nov-19 15:14
Member 245846713-Nov-19 15:14 
GeneralRe: Is the command to check if the bell is running or stopped ? Pin
Richard Deeming14-Nov-19 1:12
mveRichard Deeming14-Nov-19 1:12 
GeneralRe: Is the command to check if the bell is running or stopped ? Pin
Member 245846717-Nov-19 14:39
Member 245846717-Nov-19 14:39 
GeneralRe: Is the command to check if the bell is running or stopped ? Pin
Richard Deeming17-Nov-19 22:23
mveRichard Deeming17-Nov-19 22:23 
GeneralRe: Is the command to check if the bell is running or stopped ? Pin
Member 245846720-Nov-19 15:56
Member 245846720-Nov-19 15:56 
QuestionLooking for Text To Speech library for C# ? Pin
Member 24584677-Nov-19 16:01
Member 24584677-Nov-19 16:01 
AnswerRe: Looking for Text To Speech library for C# ? Pin
Richard MacCutchan7-Nov-19 21:04
mveRichard MacCutchan7-Nov-19 21:04 
GeneralRe: Looking for Text To Speech library for C# ? Pin
Member 245846710-Nov-19 17:10
Member 245846710-Nov-19 17:10 
GeneralRe: Looking for Text To Speech library for C# ? Pin
Richard MacCutchan10-Nov-19 22:15
mveRichard MacCutchan10-Nov-19 22:15 
GeneralRe: Looking for Text To Speech library for C# ? Pin
kalberts10-Nov-19 22:54
kalberts10-Nov-19 22:54 
GeneralRe: Looking for Text To Speech library for C# ? Pin
Richard MacCutchan11-Nov-19 0:11
mveRichard MacCutchan11-Nov-19 0:11 
GeneralRe: Looking for Text To Speech library for C# ? Pin
Member 245846712-Nov-19 15:33
Member 245846712-Nov-19 15:33 
GeneralRe: Looking for Text To Speech library for C# ? Pin
Richard MacCutchan12-Nov-19 22:07
mveRichard MacCutchan12-Nov-19 22:07 
QuestionHow should I handle versioning of my application that contains versioning information about products? Pin
arnold_w7-Nov-19 1:32
arnold_w7-Nov-19 1:32 
AnswerRe: How should I handle versioning of my application that contains versioning information about products? Pin
Eddy Vluggen7-Nov-19 2:19
professionalEddy Vluggen7-Nov-19 2:19 
AnswerRe: How should I handle versioning of my application that contains versioning information about products? Pin
phil.o7-Nov-19 4:02
professionalphil.o7-Nov-19 4:02 

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.