private int getFlagNum(CheckBox chk) { try { string source = chk.Name; return Convert.ToInt32(source.Substring(Math.Max(0, source.Length - 4))); } catch { return 0; } } private void changeCustomBool(object sender, EventArgs e)