• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.MaskedTextBox类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Forms.MaskedTextBox的典型用法代码示例。如果您正苦于以下问题:C# MaskedTextBox类的具体用法?C# MaskedTextBox怎么用?C# MaskedTextBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MaskedTextBox类属于System.Windows.Forms命名空间,在下文中一共展示了MaskedTextBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: validar

 public static bool validar(MaskedTextBox msk)
 {
     if (!msk.MaskFull)
         return false;
     else
         return true;
 }
开发者ID:Rimolo,项目名称:Restaurante,代码行数:7,代码来源:Utilidades.cs


示例2: IsValidMaskDescriptor

 public static bool IsValidMaskDescriptor(MaskDescriptor maskDescriptor, out string validationErrorDescription)
 {
     validationErrorDescription = string.Empty;
     if (maskDescriptor == null)
     {
         validationErrorDescription = System.Design.SR.GetString("MaskDescriptorNull");
         return false;
     }
     if ((string.IsNullOrEmpty(maskDescriptor.Mask) || string.IsNullOrEmpty(maskDescriptor.Name)) || string.IsNullOrEmpty(maskDescriptor.Sample))
     {
         validationErrorDescription = System.Design.SR.GetString("MaskDescriptorNullOrEmptyRequiredProperty");
         return false;
     }
     MaskedTextProvider maskedTextProvider = new MaskedTextProvider(maskDescriptor.Mask, maskDescriptor.Culture);
     MaskedTextBox box = new MaskedTextBox(maskedTextProvider) {
         SkipLiterals = true,
         ResetOnPrompt = true,
         ResetOnSpace = true,
         ValidatingType = maskDescriptor.ValidatingType,
         FormatProvider = maskDescriptor.Culture,
         Culture = maskDescriptor.Culture
     };
     box.TypeValidationCompleted += new TypeValidationEventHandler(MaskDescriptor.maskedTextBox1_TypeValidationCompleted);
     box.MaskInputRejected += new MaskInputRejectedEventHandler(MaskDescriptor.maskedTextBox1_MaskInputRejected);
     box.Text = maskDescriptor.Sample;
     if ((box.Tag == null) && (maskDescriptor.ValidatingType != null))
     {
         box.ValidateText();
     }
     if (box.Tag != null)
     {
         validationErrorDescription = box.Tag.ToString();
     }
     return (validationErrorDescription.Length == 0);
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:35,代码来源:MaskDescriptor.cs


示例3: LibroHandler

 //Constructor
 public LibroHandler(Element.NumericUpDown updwLibro, Element.NumericUpDown updwRenglon, Element.MaskedTextBox txtNroFolio, Element.TextBox txtDescripcion)
 {
     this.updwLibro = updwLibro;
     this.updwRenglon = updwRenglon;
     this.txtNroFolio = txtNroFolio;
     this.txtDescripcion = txtDescripcion;
 }
开发者ID:nahueld,项目名称:CoffeeAndCake,代码行数:8,代码来源:LibroHandler.cs


示例4: DateTimePickerPresentation

        /// <summary>
        /// Initializes a new instance of the 'DateTimePickerPresentation' class.
        /// </summary>
        /// <param name="maskedTextBox">.NET MaskedTextBox reference.</param>
        /// <param name="dateTimePicker">.NET DateTimePicker reference.</param>
        public DateTimePickerPresentation(MaskedTextBox maskedTextBox, DateTimePicker dateTimePicker)
        {
            mMaskedTextBoxIT = maskedTextBox;
            mDateTimePickerIT = dateTimePicker;
            if (mMaskedTextBoxIT != null)
            {
                // Create and configure the ErrorProvider control.
                mErrorProvider = new ErrorProvider();
                mErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

                // Link MaskedTextBox control events.
                mMaskedTextBoxIT.GotFocus += new EventHandler(HandleMaskedTextBoxITGotFocus);
                mMaskedTextBoxIT.LostFocus += new EventHandler(HandleMaskedTextBoxITLostFocus);
                mMaskedTextBoxIT.TextChanged += new EventHandler(HandleMaskedTextBoxITTextChanged);
                mMaskedTextBoxIT.EnabledChanged += new EventHandler(HandleMaskedTextBoxITEnabledChanged);
                mMaskedTextBoxIT.KeyDown += new KeyEventHandler(HandleMaskedTextBoxITKeyDown);
            }

            if (dateTimePicker != null)
            {
                mDateTimePickerIT.Enter += new System.EventHandler(HandleDateTimePickerITEnter);
                mDateTimePickerIT.KeyUp += new System.Windows.Forms.KeyEventHandler(HandleDateTimePickerITKeyUp);
                mDateTimePickerIT.DropDown += new System.EventHandler(HandleDateTimePickerITDropDown);
                mDateTimePickerIT.CloseUp += new System.EventHandler(HandleDateTimePickerCloseUp);
            }
        }
开发者ID:sgon1853,项目名称:UPM_MDD_Thesis,代码行数:31,代码来源:DateTimePickerPresentation.cs


示例5: GetDesignMaskedTextBox

 internal static MaskedTextBox GetDesignMaskedTextBox(MaskedTextBox mtb)
 {
     MaskedTextBox box = null;
     if (mtb == null)
     {
         box = new MaskedTextBox();
     }
     else
     {
         if (mtb.MaskedTextProvider == null)
         {
             box = new MaskedTextBox {
                 Text = mtb.Text
             };
         }
         else
         {
             box = new MaskedTextBox(mtb.MaskedTextProvider);
         }
         box.ValidatingType = mtb.ValidatingType;
         box.BeepOnError = mtb.BeepOnError;
         box.InsertKeyMode = mtb.InsertKeyMode;
         box.RejectInputOnFirstFailure = mtb.RejectInputOnFirstFailure;
         box.CutCopyMaskFormat = mtb.CutCopyMaskFormat;
         box.Culture = mtb.Culture;
     }
     box.UseSystemPasswordChar = false;
     box.PasswordChar = '\0';
     box.ReadOnly = false;
     box.HidePromptOnLeave = false;
     return box;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:32,代码来源:MaskedTextBoxDesigner.cs


示例6: MaskedTextBoxAdv

 /// <summary>
 /// Initializes a new instance of the MaskedTextBoxAdv class.
 /// </summary>
 public MaskedTextBoxAdv()
 {
     this.SetStyle(ControlStyles.Selectable, false);
     _MaskedTextBox = new MaskedTextBoxInternal();
     this.BackColor = SystemColors.Window;
     InitControl();
 }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:10,代码来源:MaskedTextBoxAdv.cs


示例7: InitializeControl

        private void InitializeControl()
        {
            SuspendLayout();
            _maskedTextBox = new MaskedTextBox
                                 {
                                     Mask = "00/00/0000",
                                     Size = new Size(139, 20),
                                     Location = new Point(0, 0),
                                     TabIndex = 0,
                                     ValidatingType = typeof (DateTime),
                                 };

            _dropDownButton = new Button();
            _dropDownButton.Size = new Size(16, 16);
            _dropDownButton.FlatStyle = FlatStyle.Standard;
            _dropDownButton.BackColor = Color.White;
            _dropDownButton.Location = new Point(_maskedTextBox.Width - 20, 1);
            _dropDownButton.BackgroundImage = Strings.calendar_icon;
            _dropDownButton.Click += OnDropDownButtonClick;
            _dropDownButton.Cursor = Cursors.Arrow;
            _maskedTextBox.Controls.Add(_dropDownButton);
            AutoScaleMode=AutoScaleMode.Dpi;
            _maskedTextBox.Text = DateTime.Now.ToString("dd/MM/yyyy");
            Controls.Add(_maskedTextBox);
            ResumeLayout(true);
        }
开发者ID:gitter-badger,项目名称:UROCare,代码行数:26,代码来源:DatePickerControl.cs


示例8: MaskedTextBoxTextEditorDropDown

 public MaskedTextBoxTextEditorDropDown(MaskedTextBox maskedTextBox)
 {
     this.cloneMtb = MaskedTextBoxDesigner.GetDesignMaskedTextBox(maskedTextBox);
     this.errorProvider = new ErrorProvider();
     ((ISupportInitialize) this.errorProvider).BeginInit();
     base.SuspendLayout();
     this.cloneMtb.Dock = DockStyle.Fill;
     this.cloneMtb.TextMaskFormat = MaskFormat.IncludePromptAndLiterals;
     this.cloneMtb.ResetOnPrompt = true;
     this.cloneMtb.SkipLiterals = true;
     this.cloneMtb.ResetOnSpace = true;
     this.cloneMtb.Name = "MaskedTextBoxClone";
     this.cloneMtb.TabIndex = 0;
     this.cloneMtb.MaskInputRejected += new MaskInputRejectedEventHandler(this.maskedTextBox_MaskInputRejected);
     this.cloneMtb.KeyDown += new KeyEventHandler(this.maskedTextBox_KeyDown);
     this.errorProvider.BlinkStyle = ErrorBlinkStyle.NeverBlink;
     this.errorProvider.ContainerControl = this;
     base.Controls.Add(this.cloneMtb);
     this.BackColor = SystemColors.Control;
     base.BorderStyle = BorderStyle.FixedSingle;
     base.Name = "MaskedTextBoxTextEditorDropDown";
     base.Padding = new Padding(0x10);
     base.Size = new Size(100, 0x34);
     ((ISupportInitialize) this.errorProvider).EndInit();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:MaskedTextBoxTextEditorDropDown.cs


示例9: MaskDesignerDialog

 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();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:MaskDesignerDialog.cs


示例10: ParteHandler

        public ParteHandler(Element.ComboBox cboTipoDoc, Element.MaskedTextBox txtNroDni, Element.ComboBox cboSexo,
                            Element.TextBox txtNombre, Element.TextBox txtApellido, Element.MaskedTextBox txtCuit,
                            Element.DateTimePicker dpFecNac, Element.ComboBox cboECivil, Element.TextBox txtDomicilio,
                            Element.ComboBox cboCiudad, Element.ComboBox cboDepartamento, Element.ComboBox cboProvincia,
                            Element.ComboBox cboNacionalidad)
        {
            this.cboTipoDoc = cboTipoDoc;
            this.txtNroDni = txtNroDni;
            this.cboSexo = cboSexo;
            this.txtNombre = txtNombre;
            this.txtApellido = txtApellido;
            this.txtCuit = txtCuit;
            this.dpFecNac = dpFecNac;
            this.cboECivil = cboECivil;
            this.txtDomicilio = txtDomicilio;
            this.cboCiudad = cboCiudad;
            this.cboDepartamento = cboDepartamento;
            this.cboProvincia = cboProvincia;
            this.cboNacionalidad = cboNacionalidad;

            formatoPartes();

            con.Connect();
            ds1 = con.fillDs("SELECT * FROM DOCUMENTOS;", "PARTES");
            ds2 = con.fillDs("SELECT * FROM SEXOS;", "SEXOS");
            ds3 = con.fillDs("SELECT * FROM ESTADOS_CIVILES;", "ESTADOS");
            ds7 = con.fillDs("SELECT * FROM NACIONALIDADES;", "NACIONALIDADES");
            cboTipoDoc.DataSource = ds1.Tables[0];
            cboSexo.DataSource = ds2.Tables[0];
            cboECivil.DataSource = ds3.Tables[0];
            cboNacionalidad.DataSource = ds7.Tables[0];
        }
开发者ID:nahueld,项目名称:CoffeeAndCake,代码行数:32,代码来源:ParteHandler.cs


示例11: EditValue

 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     IWindowsFormsEditorService service = null;
     if (((context != null) && (context.Instance != null)) && (provider != null))
     {
         service = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
         if ((service == null) || (context.Instance == null))
         {
             return value;
         }
         MaskedTextBox instance = context.Instance as MaskedTextBox;
         if (instance == null)
         {
             instance = new MaskedTextBox {
                 Text = value as string
             };
         }
         MaskedTextBoxTextEditorDropDown control = new MaskedTextBoxTextEditorDropDown(instance);
         service.DropDownControl(control);
         if (control.Value != null)
         {
             value = control.Value;
         }
     }
     return value;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:26,代码来源:MaskedTextBoxTextEditor.cs


示例12: clsGLAcLookUp

 //
 public clsGLAcLookUp( MaskedTextBox pTB, string pTitle,string pJoin = "", string pAddWhere = ""  )
 {
     fTB = pTB;
       fTitle = pTitle;
       fJoin = pJoin;
       fAddWhere = pAddWhere;
 }
开发者ID:naveed02,项目名称:C_Sharp_Practice,代码行数:8,代码来源:clsGLAcLookUp.cs


示例13: VehiculoHandler

        Element.TextBox txtPrefijo; // txt prefijo del vehiculo

        #endregion Fields

        #region Constructors

        public VehiculoHandler(Element.ComboBox cboDesc, Element.ComboBox cboMarca, Element.MaskedTextBox txtDominio, Element.TextBox txtPrefijo)
        {
            this.cboDesc = cboDesc;
            this.cboMarca = cboMarca;
            this.txtDominio = txtDominio;
            this.txtPrefijo = txtPrefijo;
        }
开发者ID:nahueld,项目名称:CoffeeAndCake,代码行数:13,代码来源:VehiculoHandler.cs


示例14: validarMaskedTextBox

 public static bool validarMaskedTextBox(MaskedTextBox unMaskedTextBox, String unMensajeDeAlerta)
 {
     if (unMaskedTextBox.Text.Length < 1)
     {
         MessageBox.Show(unMensajeDeAlerta);
         return false;
     }
     return true;
 }
开发者ID:martinnbasile,项目名称:aerolineaFRBA,代码行数:9,代码来源:Validaciones.cs


示例15: ValidateMaskedTextbox

        public bool ValidateMaskedTextbox(MaskedTextBox test)
        {
            if (test.Text.Length == 0)
            {
                test.BackColor = _invalidColor;
                return false;
            }

            test.BackColor = _validColor;
            return true;
        }
开发者ID:jnnpsubm,项目名称:YAR-Auth,代码行数:11,代码来源:WizardMain.cs


示例16: MaskedTextBoxDesignerActionList

 public MaskedTextBoxDesignerActionList(MaskedTextBoxDesigner designer) : base(designer.Component)
 {
     this.maskedTextBox = (MaskedTextBox) designer.Component;
     this.discoverySvc = base.GetService(typeof(ITypeDiscoveryService)) as ITypeDiscoveryService;
     this.uiSvc = base.GetService(typeof(IUIService)) as IUIService;
     this.helpService = base.GetService(typeof(IHelpService)) as IHelpService;
     if (this.discoverySvc != null)
     {
         IUIService uiSvc = this.uiSvc;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:MaskedTextBoxDesignerActionList.cs


示例17: getFieldControl

        public Control getFieldControl(object Value)
        {
            MaskedTextBox dateTimeFieldControl = new MaskedTextBox("00/00/0000 90:00");
            dateTimeFieldControl.ValidatingType = typeof(DateTime);
            if(((DateTime) Value).CompareTo(DateTime.MinValue)==0)
                dateTimeFieldControl.Text = string.Empty;
            else
                dateTimeFieldControl.Text = Value.ToString();

            return dateTimeFieldControl;
        }
开发者ID:oferfrid,项目名称:OctoTip,代码行数:11,代码来源:DateTimeField.cs


示例18: WordWrapTest

		public void WordWrapTest ()
		{

			MaskedTextBox mtb;

			mtb = new MaskedTextBox ();
			Assert.AreEqual (false, mtb.WordWrap, "#W1");
			mtb.WordWrap = true;
			Assert.AreEqual (false, mtb.WordWrap, "#W2");
			
			mtb.Dispose ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:12,代码来源:MaskedTextBoxTest.cs


示例19: validarMatricula

 public static bool validarMatricula(MaskedTextBox unMaskedTextBox, String unMensajeDeAlerta)
 {
     if (Regex.Match(unMaskedTextBox.Text, "[A-Z][A-Z][A-Z][-][0-9][0-9][0-9]").Success)
     {
         return true;
     }
     else
     {
         MessageBox.Show(unMensajeDeAlerta);
         return false;
     }
 }
开发者ID:martinnbasile,项目名称:aerolineaFRBA,代码行数:12,代码来源:Validaciones.cs


示例20: AutonumericPresentation

        /// <summary>
        /// Creates a new instance for an autonumeric
        /// </summary>
        /// <param name="maskedTextBox"></param>
        /// <param name="label"></param>
        /// <param name="checkBox"></param>
        public AutonumericPresentation(MaskedTextBox maskedTextBox, Label label, CheckBox checkBox)
            : base(maskedTextBox)
        {
            mAutoMode = true;
            mAutoLabelIT = label;
            mCheckBoxIT = checkBox;
            DataType = ModelType.Autonumeric;

            if (mCheckBoxIT != null)
            {
                mCheckBoxIT.CheckedChanged += new EventHandler(HandleCheckBoxITChanged);
            }
        }
开发者ID:sgon1853,项目名称:UPM_MDD_Thesis,代码行数:19,代码来源:AutonumericPresentation.cs



注:本文中的System.Windows.Forms.MaskedTextBox类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.MeasureItemEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Forms.MaskInputRejectedEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap