//商品数量 private void numericUpDown1_ValueChanged(object sender, EventArgs e) { tempsplus = Int32.Parse(this.numericUpDown1.Value.ToString()); this.label3.Text = "¥" + Convert.ToDecimal((float.Parse(Wprice) * tempsplus).ToString()).ToString("F2"); OnCheckedChanged?.Invoke(sender, e); }
//加号 protected void Button2_Click(object sender, EventArgs e) { this.TextBox1.Text = (int.Parse(this.TextBox1.Text.ToString()) + 1).ToString(); tempSplus = this.TextBox1.Text.ToString(); this.Label3.Text = $"¥{int.Parse(tempSplus) * tempPric:F2}"; OnCheckedChanged?.Invoke(sender, e); }
private void frontPanel_Click(object sender, EventArgs e) { clicks++; isChecked = false; OnCheckedChanged?.Invoke(false); CheckClicks(); }
private void backPanel_Click(object sender, EventArgs e) { clicks++; isChecked = true; OnCheckedChanged?.Invoke(true); CheckClicks(); }
public virtual void Checked(GameTime time) { if (!Enabled) { return; } IsChecked = !IsChecked; OnCheckedChanged?.Invoke(this, EventArgs.Empty); }
private void Lb_ItemCheck(object sender, ItemCheckEventArgs e) { Enum changedItem = (Enum)lb.Items[e.Index]; if (e.NewValue == CheckState.Checked) { _value = _value.SetFlags(changedItem); } else { _value = _value.ClearFlags(changedItem); } OnCheckedChanged?.Invoke(this, changedItem); textbox.Text = _value.ToString(); }
//减号 protected void Button1_Click(object sender, EventArgs e) { if (int.Parse(this.TextBox1.Text.ToString()) > 1) { this.TextBox1.Text = (int.Parse(this.TextBox1.Text.ToString()) - 1).ToString(); } else { this.TextBox1.Text = "1"; } //int temnum = int.Parse(this.TextBox1.Text.ToString()); tempSplus = this.TextBox1.Text.ToString(); this.Label3.Text = $"¥{int.Parse(tempSplus) * tempPric:F2}"; OnCheckedChanged?.Invoke(sender, e); }
public WidgetCheckbox(int x, int y, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = -1) : base(new Rectangle(x, y, 0, 0), filePath, lineNumber) { _checkedImage = new WidgetImage("art/interface/options_ui/checkbox_on.tga"); AddContent(_checkedImage); _uncheckedImage = new WidgetImage("art/interface/options_ui/checkbox_off.tga"); AddContent(_uncheckedImage); SetClickHandler(() => { Checked = !Checked; OnCheckedChanged?.Invoke(Checked); }); SetSize(_checkedImage.GetPreferredSize()); }
//选择状态改变 private void checkBox1_CheckedChanged(object sender, EventArgs e) { OnCheckedChanged?.Invoke(sender, e); //if (OnCheckedChanged != null) OnCheckedChanged(sender, e); }
protected void CheckBox1_CheckedChanged(object sender, EventArgs e) { OnCheckedChanged?.Invoke(sender, e); }