private bool btn_Click(UIObject sender, MouseButtonEventArgs e) { if (e.Button == MouseButtons.Left) { if (KeyboardUtils.Shift) { Main.NewText("CheckBox is " + (chk.Checked ? "checked" : "not checked")); } else if (KeyboardUtils.Control) { Main.NewText("NumberBox value is " + num.Value); } else { Main.NewText("You entered " + tb.Text); } return(true); } else if (e.Button == MouseButtons.Right) { bar.Step(); if (bar.Value >= bar.Maximum) { bar.Reset(); } return(true); } return(false); }