/// <summary> /// 方法说明:初始化控件并赋默认值 /// 作 者:jason.tang /// 完成时间:2013-01-04 /// </summary> private void InitControls() { ComboBoxSourceHelper com = new ComboBoxSourceHelper(); com.BinderEnum <ComboBoxSourceHelper.CellType>(this.comboType, 1); com.BinderEnum <ComboBoxSourceHelper.CellStyle>(this.comboStyle, 1); comboType.Items.RemoveAt(2); comboType.Items.RemoveAt(2); comboType.Items.RemoveAt(2); comboType.Items.Insert(0, "不改变类型"); comboStyle.Items.Insert(0, "不改变样式"); rdbtnCenter.Checked = true; rdbtnMiddle.Checked = true; txtUp.Text = "0"; txtDown.Text = "0"; txtLeft.Text = "0"; txtRight.Text = "0"; #region TextBox校验事件 txtUp.TextChanged += new EventHandler(TextBox_TextChanged); txtDown.TextChanged += new EventHandler(TextBox_TextChanged); txtLeft.TextChanged += new EventHandler(TextBox_TextChanged); txtRight.TextChanged += new EventHandler(TextBox_TextChanged); txtUp.Validating += new CancelEventHandler(TextBox_Validating); txtDown.Validating += new CancelEventHandler(TextBox_Validating); txtLeft.Validating += new CancelEventHandler(TextBox_Validating); txtRight.Validating += new CancelEventHandler(TextBox_Validating); #endregion }
/// <summary> /// 方法说明:初始化控件并赋默认值 /// 作 者:jason.tang /// 完成时间:2012-12-18 /// </summary> private void InitControls() { ComboBoxSourceHelper com = new ComboBoxSourceHelper(); com.BinderEnum <ComboBoxSourceHelper.PageBreadth>(comboBreadth, 4); com.BinderEnum <ComboBoxSourceHelper.CardType>(comboCardType, 0); dicBreadth = new Dictionary <string, Point>(); List <Point> listSize = new List <Point>(); listSize.Add(new Point(1189, 841)); listSize.Add(new Point(841, 594)); listSize.Add(new Point(594, 420)); listSize.Add(new Point(420, 297)); listSize.Add(new Point(297, 210)); listSize.Add(new Point(210, 148)); for (int i = 0; i < 6; i++) { dicBreadth.Add(comboBreadth.Items[i].ToString(), listSize[i]); } txtWidth.Text = dicBreadth["A4"].X.ToString(); txtHeight.Text = dicBreadth["A4"].Y.ToString(); ckPrintAdjust.Checked = true; txtPrintScale.Text = "100"; txtOffsetLeft.Text = "0"; txtOffsetTop.Text = "0"; rdbtnHorizontal.Select(); txtPaddingLeft.Text = "5"; txtPaddingRight.Text = "5"; txtPaddingTop.Text = "5"; txtPaddingBottom.Text = "5"; txtCardName.Height = 23; }
/// <summary> /// 方法说明:初始化变量 /// 作 者:jason.tang /// 完成时间:2013-01-09 /// </summary> private void InitVariable(bool isDelete) { if (_dicDetailColumns != null && !isDelete) { dicColumns = new Dictionary <string, DetailGridViewTextBoxColumn>(); foreach (DetailGridViewTextBoxColumn col in _dicDetailColumns) { dicColumns.Add(col.ColumnName, col); } } lbColumns.DisplayMember = "Key"; lbColumns.ValueMember = "Value"; ComboBoxSourceHelper com = new ComboBoxSourceHelper(); com.BinderEnum <ComboBoxSourceHelper.AdvanceProperty>(this.comboAdvanceProperty, 0); }