private void cmbPage_SelectedIndexChanged(object sender, EventArgs e) { if (cmbPage.SelectedIndex == cmbPage.Items.Count - 1) { // "Custom..." selected var form = FormFactory.Create <FPageSize>(); form.PageSizeDimens = lastPageSizeItem.Type == ScanPageSize.Custom ? lastPageSizeItem.CustomDimens : lastPageSizeItem.Type.PageDimensions(); if (form.ShowDialog() == DialogResult.OK) { UpdatePageSizeList(); SelectCustomPageSize(form.PageSizeName, form.PageSizeDimens); } else { cmbPage.SelectedIndex = lastPageSizeIndex; } } lastPageSizeIndex = cmbPage.SelectedIndex; lastPageSizeItem = (PageSizeListItem)cmbPage.SelectedItem; }
private void cmbPage_SelectedIndexChanged(object sender, EventArgs e) { if (cmbPage.SelectedIndex == cmbPage.Items.Count - 1) { // "Custom..." selected var form = FormFactory.Create<FPageSize>(); form.PageSizeDimens = lastPageSizeItem.Type == ScanPageSize.Custom ? lastPageSizeItem.CustomDimens : lastPageSizeItem.Type.PageDimensions(); if (form.ShowDialog() == DialogResult.OK) { UpdatePageSizeList(); SelectCustomPageSize(form.PageSizeName, form.PageSizeDimens); } else { cmbPage.SelectedIndex = lastPageSizeIndex; } } lastPageSizeIndex = cmbPage.SelectedIndex; lastPageSizeItem = (PageSizeListItem)cmbPage.SelectedItem; }