private void btnAdd_Click(object sender, EventArgs e) { frmSelItem formSelItem = new frmSelItem(); CardObjectType objectType = CardObjectType.label; if (formSelItem.ShowDialog(ref objectType) == DialogResult.OK) { int selItem = -1; if (objectType == CardObjectType.image) { selItem = deck.CardFore.AddImage(); } else if (objectType == CardObjectType.text) { selItem = deck.CardFore.AddText(); } else if (objectType == CardObjectType.shape) { selItem = deck.CardFore.AddShape(); } else { selItem = deck.CardFore.AddLabel(); } ShowCard(selItem); } }
public DialogResult ShowDialog(ref CardObjectType selType) { if (selType == CardObjectType.label) { rbLabel.Checked = true; } else if (selType == CardObjectType.text) { rbText.Checked = true; } else if (selType == CardObjectType.image) { rbImage.Checked = true; } else if (selType == CardObjectType.shape) { rbShape.Checked = true; } DialogResult res = base.ShowDialog(); if (rbLabel.Checked) { selType = CardObjectType.label; } else if (rbImage.Checked) { selType = CardObjectType.image; } else if (rbText.Checked) { selType = CardObjectType.text; } else if (rbShape.Checked) { selType = CardObjectType.shape; } return(res); }