public MaskDesignerDialog(MaskedTextBox instance, IHelpService helpService) { if (instance == null) { this.maskedTextBox = new MaskedTextBox(); } else { this.maskedTextBox = MaskedTextBoxDesigner.GetDesignMaskedTextBox(instance); } this.helpService = helpService; this.InitializeComponent(); DesignerUtils.ApplyListViewThemeStyles(this.listViewCannedMasks); base.SuspendLayout(); this.txtBoxMask.Text = this.maskedTextBox.Mask; this.AddDefaultMaskDescriptors(this.maskedTextBox.Culture); this.maskDescriptionHeader.Text = System.Design.SR.GetString("MaskDesignerDialogMaskDescription"); this.maskDescriptionHeader.Width = this.listViewCannedMasks.Width / 3; this.dataFormatHeader.Text = System.Design.SR.GetString("MaskDesignerDialogDataFormat"); this.dataFormatHeader.Width = this.listViewCannedMasks.Width / 3; this.validatingTypeHeader.Text = System.Design.SR.GetString("MaskDesignerDialogValidatingType"); this.validatingTypeHeader.Width = ((this.listViewCannedMasks.Width / 3) - SystemInformation.VerticalScrollBarWidth) - 4; base.ResumeLayout(false); this.HookEvents(); }
/// <summary> /// Constructor receiving a clone of the MaskedTextBox control under design. /// </summary> public MaskDesignerDialog(MaskedTextBox instance, IHelpService helpService) { if (instance is null) { Debug.Fail("Null masked text box, creating default."); _maskedTextBox = new MaskedTextBox(); } else { _maskedTextBox = MaskedTextBoxDesigner.GetDesignMaskedTextBox(instance); } _helpService = helpService; InitializeComponent(); // Enable Vista Explorer listview style DesignerUtils.ApplyListViewThemeStyles(_listViewCannedMasks); // Non-designer-handled stuff. SuspendLayout(); _txtBoxMask.Text = _maskedTextBox.Mask; // Add default mask descriptors to the mask description list. AddDefaultMaskDescriptors(_maskedTextBox.Culture); // // maskDescriptionHeader // _maskDescriptionHeader.Text = SR.MaskDesignerDialogMaskDescription; _maskDescriptionHeader.Width = _listViewCannedMasks.Width / 3; // // dataFormatHeader // _dataFormatHeader.Text = SR.MaskDesignerDialogDataFormat; _dataFormatHeader.Width = _listViewCannedMasks.Width / 3; // // validatingTypeHeader // _validatingTypeHeader.Text = SR.MaskDesignerDialogValidatingType; _validatingTypeHeader.Width = (_listViewCannedMasks.Width / 3) - SystemInformation.VerticalScrollBarWidth - 4; // so no h-scrollbar. ResumeLayout(false); HookEvents(); }
internal StyleEditorForm(CollectionEditor editor, bool isRowCollection) : base(editor) { this.editor = (StyleCollectionEditor)editor; this.isRowCollection = isRowCollection; this.InitializeComponent(); this.HookEvents(); DesignerUtils.ApplyListViewThemeStyles(this.columnsAndRowsListView); base.ActiveControl = this.columnsAndRowsListView; this.tlp = base.Context.Instance as TableLayoutPanel; this.tlp.SuspendLayout(); this.deleteList = new ArrayList(); IDesignerHost service = this.tlp.Site.GetService(typeof(IDesignerHost)) as IDesignerHost; if (service != null) { this.tlpDesigner = service.GetDesigner(this.tlp) as TableLayoutPanelDesigner; this.compSvc = service.GetService(typeof(IComponentChangeService)) as IComponentChangeService; } this.rowStyleProp = TypeDescriptor.GetProperties(this.tlp)["RowStyles"]; this.colStyleProp = TypeDescriptor.GetProperties(this.tlp)["ColumnStyles"]; this.tlpDesigner.SuspendEnsureAvailableStyles(); }