private bool InitObj(bool clear = true) { BarCode.Control.FrmSetName frm = new BarCode.Control.FrmSetName(); DialogResult dia = frm.ShowDialog(); if (dia == DialogResult.Yes) { //并且模板名称为空 TempletName = ""; //标示当前状态为新建模板 NewTemp = true; //并且模板ID为空 TempletID = Guid.NewGuid().ToString(); TempletName = frm.Name; lab_templetName.Text = TempletName; if (clear) { //清空对像 designer1.Items.Clear(); designer1.Refresh(); } return(true); } else { return(false); } }
private void toolStripButton1_Click(object sender, EventArgs e) { //Dictionary<string, string> dic = new Dictionary<string, string>(); //dic["t1"] = "O:123456789"; //dic["t2"] = "N:ABCDEFGHIGK"; //dic["code"] = "1234567890"; //InOutPut.PrintTemplet("a", dic); BarCode.Control.FrmSetName frm = new BarCode.Control.FrmSetName(); DialogResult dia = frm.ShowDialog(); if (dia == DialogResult.Yes) { TempletName = frm.Name; lab_templetName.Text = TempletName; designer1.RowHeight = (int)CommonSettings.MillimeterConvertPixel((float)numRowHeight.Value); designer1.PageRows = (int)numRows.Value; InOutPut.SaveFile(designer1, TempletName); MessageBox.Show("另存文件成功", "", MessageBoxButtons.OK, MessageBoxIcon.Information); } }