private void cmbPicType_SelectedIndexChanged(object sender, EventArgs e) { if (this.cmbPicType.Enabled) { if (this.cmbPicType.Text == PPCConvert.PicType2String(InterPicType.ResourcePic)) { this.numFileIndex.Enabled = false; FrmRESPicture picture = new FrmRESPicture { WindowState = FormWindowState.Normal }; if (picture.ShowDialog() == DialogResult.OK) { this.info.FileOid = picture.SelectedPicture.Oid; } else { this.cmbPicType.Text = PPCConvert.PicType2String(InterPicType.SourceFile); } } else { this.numFileIndex.Enabled = true; } } }
public DlgPicture(string xml, bool readOnly) { this.InitializeComponent(); this.cmbPicType.Items.Add(PPCConvert.PicType2String(InterPicType.SourceFile)); this.cmbPicType.Items.Add(PPCConvert.PicType2String(InterPicType.ResourcePic)); this.chkGrayscale.Checked = PLSystemParam.GrayResPicWhenPrint; if (PPCardCompiler.ExplainInterPicXml(xml, this.info)) { this.cmbPicType.Enabled = false; this.cmbPicType.Text = PPCConvert.PicType2String(this.info.Type); this.cmbPicType.Enabled = true; if (this.info.FileIndex >= 0) { this.numFileIndex.Value = Convert.ToDecimal(this.info.FileIndex); } else { this.numFileIndex.Enabled = false; } this.txtCellStart.Text = this.info.CellStart; this.txtCellEnd.Text = this.info.CellEnd; this.chkGrayscale.Checked = this.info.Grayscale; } else { this.cmbPicType.SelectedIndex = 0; } if (readOnly) { this.panel1.Enabled = false; this.btnOk.Visible = false; this.btnCancel.Text = "确定"; } }