Good day to all, Please i need your support on how to modify the program below so that it can read the data(temperature value) sent from the microcontroller as long as the Checkbox is checked.At the moment the function Code: myFtdiDevice.Read(readData, numBytesToRead, ref numBytesRead); reads only the first temperature value sent from the microcontroller,the subsequent temperatue values are not being updated even though the Checkbox is still checked.I would be very glad if somebody could put me through on how to create a Loop as Long as the Checkbox is checked.Thank you for the usual Support.Best regards. Code: private void checkBox1_CheckedChanged(object sender, EventArgs e) { UInt32 numBytesRead = 0; UInt32 numBytesToRead = 1; byte[] readData = new byte[10]; ftStatus = myFtdiDevice.Read(readData, numBytesToRead, ref numBytesRead); label11.Text = Convert.ToString(readData[0]); }
Hey, try using this code : Code: var sList = ""; $('input[type=checkbox]').each(function () { var sThisVal = (this.checked ? "1" : "0"); sList += (sList=="" ? sThisVal : "," + sThisVal); }); console.log (sList);
Hi, You can loop through the checkbox as follow Code: foreach (var control in this.Controls) { if (control is CheckBox) { if (((CheckBox)control).Checked) { //update } else { //update another } } } Thanks