private void btSetRgb_Click(object sender, EventArgs e) { wclWeDoHub Hub = GetHub(); wclWeDoRgbLight Rgb = FRobot.GetRgbDevice(Hub); if (Rgb != null) { Color c = Color.FromRgb(Convert.ToByte(edR.Text), Convert.ToByte(edG.Text), Convert.ToByte(edB.Text)); Int32 Res = Rgb.SetColor(c); if (Res != wclErrors.WCL_E_SUCCESS) { MessageBox.Show("Unable to set color: 0x" + Res.ToString("X8")); } } }
private void BtSetRgb_Click(Object Sender, EventArgs e) { if (FRgb == null) { MessageBox.Show("Device is not attached"); } else { Color c = Color.FromRgb(Convert.ToByte(edR.Text), Convert.ToByte(edG.Text), Convert.ToByte(edB.Text)); Int32 Res = FRgb.SetColor(c); if (Res != wclErrors.WCL_E_SUCCESS) { MessageBox.Show("Unable to set color: 0x" + Res.ToString("X8")); } } }