private void CheckBox_Unchecked(object sender, RoutedEventArgs e) { if (!isConnectted) { return; } CheckBox obj = (CheckBox)sender; String con = obj.Content.ToString(); UInt64 cmdIndex = 0; if (con == "Grab") // cancel grab { DobotDll.SetEndEffectorGripper(true, false, false, ref cmdIndex); } else if (con == "Laser") // release laser { DobotDll.SetEndEffectorLaser(false, false, false, ref cmdIndex); } else if (con == "SuctionCup") { DobotDll.SetEndEffectorSuctionCup(false, false, false, ref cmdIndex); } }