Accept Solution Reject Solution. If you have left the maskedText as blank then Use C. Copy Code. Posted Feb pm Aniket Yadav. Why would you need all those problems, if DateTimePicker is much better and don't leave a room for invalid input? Posted Feb pm Sergey Alexandrovich Kryukov. Add your solution here. OK Paste as. Treat my content as plain text, not as HTML.
Existing Members Sign in to your account. This email is in use. Do you need your password? Submit your solution! When answering a question please: Read the question carefully. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem.
Insults are not welcome. A String representing the input mask. The initial value of the Mask property. If you assign a new mask to the Mask property, it will override the value set by this constructor. Skip to main content.
This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Please rate your experience Yes No. Any additional feedback? Raises the BorderStyleChanged event. Raises the CausesValidationChanged event. Raises the ChangeUICues event. Raises the Click event.
Raises the ClientSizeChanged event. Raises the ContextMenuChanged event. Raises the ContextMenuStripChanged event. Raises the ControlAdded event. Raises the ControlRemoved event. Raises the CreateControl method. Raises the CursorChanged event. Raises the DockChanged event. Raises the DoubleClick event. Raises the DpiChangedAfterParent event. Raises the DpiChangedBeforeParent event.
Raises the DragDrop event. Raises the DragEnter event. Raises the DragLeave event. Raises the DragOver event. Raises the EnabledChanged event. Raises the Enter event. Raises the FontChanged event.
Raises the ForeColorChanged event. Raises the GiveFeedback event. Raises the GotFocus event. Raises the HandleCreated event. Raises the HandleDestroyed event. Raises the HelpRequested event. Raise the HideSelectionChanged event. Raises the ImeModeChanged event. Raises the Invalidated event. Raises the IsOverwriteModeChanged event.
Raises the KeyDown event. Raises the KeyPress event. Raises the KeyUp event. Raises the Layout event. Raises the Leave event. Raises the LocationChanged event. Raises the LostFocus event. Raises the MarginChanged event. Raises the MaskChanged event. Raises the ModifiedChanged event. Raises the MouseCaptureChanged event. Raises the MouseClick event. Raises the MouseDoubleClick event. Raises the MouseDown event.
Raises the MouseEnter event. Raises the MouseHover event. Raises the MouseLeave event. Raises the MouseMove event. Raises the MouseUp event. Raises the MouseWheel event. Raises the Move event.
Raises the Paint event. Raises the BackColorChanged event when the BackColor property value of the control's container changes. Raises the BackgroundImageChanged event when the BackgroundImage property value of the control's container changes.
Raises the BindingContextChanged event when the BindingContext property value of the control's container changes. Raises the ParentChanged event. Raises the EnabledChanged event when the Enabled property value of the control's container changes. Raises the FontChanged event when the Font property value of the control's container changes. Raises the ForeColorChanged event when the ForeColor property value of the control's container changes.
Raises the VisibleChanged event when the Visible property value of the control's container changes. Raises the PreviewKeyDown event. Raises the QueryContinueDrag event. Raises the ReadOnlyChanged event. Raises the RegionChanged event. Raises the Resize event. Raises the RightToLeftChanged event. Raises the SizeChanged event. Raises the StyleChanged event. Raises the SystemColorsChanged event. Raises the TabIndexChanged event. Raises the TabStopChanged event. Raises the TextAlignChanged event.
Raises the TextChanged event. Raises the Validated event. Raises the Validating event. Raises the VisibleChanged event. Replaces the current selection in the text box with the contents of the Clipboard. Forces the control to invalidate its client area and immediately redraw itself and any child controls.
Resets the BackColor property to its default value. Causes a control bound to the BindingSource to reread all the items in the list and refresh their displayed values.
Resets the Cursor property to its default value. Resets the Font property to its default value. Resets the ForeColor property to its default value. Resets the ImeMode property to its default value.
Resets the control to handle the MouseLeave event. Resets the RightToLeft property to its default value. Resets the Text property to its default value Empty. Converts the specified ContentAlignment to the appropriate ContentAlignment to support right-to-left text. Converts the specified HorizontalAlignment to the appropriate HorizontalAlignment to support right-to-left text. Scrolls the contents of the control to the current caret position.
Activates a child control. Optionally specifies the direction in the tab order to select the control from. Sets a value indicating how a control will behave when its AutoSize property is enabled. Sets the specified bounds of the TextBoxBase control. Sets a specified ControlStyles flag to either true or false. Returns a string that represents the current masked text box. This method overrides ToString.
Undoes the last edit operation in the text box. Occurs when the value of the AcceptsTab property has changed. This event is not raised by MaskedTextBox. Occurs when the value of the BackgroundImage property changes. This event is not relevant for this class. Occurs when the value of the BackgroundImageLayout property changes. Occurs when the value of the BindingContext property changes. Occurs when the value of the BorderStyle property has changed.
Occurs when the value of the CausesValidation property changes. Occurs when the value of the ClientSize property changes. Occurs when the value of the ContextMenu property changes. Occurs when the value of the ContextMenuStrip property changes. Occurs when a new control is added to the Control. Occurs when a control is removed from the Control. Occurs when the value of the Cursor property changes. Occurs when the component is disposed by a call to the Dispose method. Occurs when the value of the Dock property changes.
Occurs when the DPI setting for a control is changed programmatically after the DPI of its parent control or form has changed. Occurs when the DPI setting for a control is changed programmatically before a DPI change event for its parent control or form has occurred.
Occurs when the Enabled property value has changed. Occurs when the Font property value changes. Occurs when the ForeColor property value changes. Occurs when the value of the HideSelection property has changed. Occurs when the ImeMode property has changed.
Occurs when the Location property value has changed. Occurs when the user's input or assigned character does not match the corresponding format element of the input mask. Occurs when the value of the Modified property has changed. Typically occurs when the value of the Multiline property has changed; however, this event is not raised by MaskedTextBox. Occurs when the Parent property value changes. Occurs before the KeyDown event when a key is pressed while focus is on this control.
Occurs when AccessibleObject is providing help to accessibility applications. Occurs during a drag-and-drop operation and enables the drag source to determine whether the drag-and-drop operation should be canceled.
Occurs when the value of the ReadOnly property has changed. Occurs when the value of the Region property changes. Occurs when the RightToLeft property value changes. Occurs when the Size property value changes. Occurs when the TabIndex property value changes.
Occurs when the TabStop property value changes. Occurs when the Text property value changes. Occurs when the Visible property value changes. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Please rate your experience Yes No.
Any additional feedback? Namespace: System. Forms Assembly: System. Uses a mask to distinguish between proper and improper user input.
Caution The MaskedTextBox control does not support multiline configuration or undo functionality. In this article. MaskedTextBox String. Inherited from Control. Gets or sets the description of the control used by accessibility client applications.
Gets or sets the name of the control used by accessibility client applications. Gets or sets the accessible role of the control. Gets or sets a value indicating whether the control can accept data that the user drags onto it.
Inherited from TextBoxBase. Gets or sets the background color of the control. Gets or sets the border type of the text box control. Gets a value indicating whether the control can receive focus.
Determines if events can be raised on the control. Gets a value indicating whether the control can be selected. Gets or sets a value indicating whether the control has captured the mouse. Gets the rectangle that represents the client area of the control. Gets or sets the height and width of the client area of the control. Gets the name of the company or creator of the application containing the control. Inherited from Component.
Gets or sets the shortcut menu associated with the control. Gets the collection of controls contained within the control. Gets a value indicating whether the control has been created.
Gets the required creation parameters when the control handle is created. Gets or sets the culture information associated with the masked text box. Gets or sets the cursor that is displayed when the mouse pointer is over the control. Gets the data bindings for the control. Gets or sets the default cursor for the control. Gets the space, in pixels, that is specified by default between controls. Gets the internal spacing, in pixels, of the contents of a control.
Gets the default size of the control. Gets the DPI value for the display device where the control is currently being displayed. Gets the rectangle that represents the display area of the control. Gets or sets a value indicating whether the control can respond to user interaction.
Gets a value indicating whether the control has input focus. Gets or sets the font of the text displayed by the control. Gets or sets the height of the font of the control.
Gets or sets the foreground color of the control. Gets the window handle that the control is bound to. Gets a value indicating whether the control contains one or more child controls.
Gets or sets the height of the control. Gets or sets a value indicating whether the control is visible to accessibility applications. Gets a value indicating whether the control has been disposed of.
Gets a value indicating whether the control has a handle associated with it.
0コメント