Telerik Forums
UI for WinForms Forum
1 answer
31 views

Since there isn't a built-in context menu for a MaskedEdit, I tried to add one. However, I can't get it to display. 

I added a contextMenuStrip and then added a menuItem.

I added the menuItem click event

I added the contextMenuStrip to the MaskedEdit field

When I test it (right-click on the field), nothing happens.

I also tried other events on the MaskedEdit field like the mouse click event and it never calls it when I click on the field.

What am I missing? (screenshot attached)


		private void miCopy_Click(object sender, EventArgs e)
		{
			try
			{
				TextBoxBase thiscontrol;
				thiscontrol = (TextBoxBase)ActiveControl;
				if (thiscontrol.SelectionLength > 0)
				{
					thiscontrol.Copy();
				}
			}
			catch (Exception)
			{
			}
		}

 

Nadya | Tech Support Engineer
Telerik team
 answered on 06 Feb 2025
1 answer
32 views

Regarding the RadMaskedEditBox using the provided Email MaskType:

The error validation icon displays when there is an error, but it doesn't prevent the user from leaving the field. 

How can I prevent the user from leaving the field with this MaskType?

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 05 Feb 2025
1 answer
70 views

I have a MaskedEditBox called mtbText bound to a string property like this:

mtbText.DataBindings.Add(nameof(mtbText.Value), customerSearch, nameof(customerSearch.Text), false, DataSourceUpdateMode.OnPropertyChanged);

        public string? Text
        {
            get => _text;
            set
            {
                if (_text != value)
                {
                    _text = value;
                    OnPropertyChanged(nameof(Text));
                }
            }
        }

Sometimes I need a specific mask like SSN or phone # and sometimes I don't.  The UI resets the properties on the single mask control depending on need. If I bind to a specific mask like this (say a SSN or phone #) it works fine. However sometimes I need a mask that will allow anything. I tried aaaaaaaaaa and a few other combination but these won't let me enter blank spaces.  If I set the MaskType to None it allow the spaces but doesn't bind to the property.

mtbText.Mask = string.IsNullOrEmpty(item.Mask) ? "aaaaaaaaaa" : item.Mask; 

mtbText.MaskType = MaskType.Standard;

mtbText.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;

What mask can I use that would allow me to enter something like 123 Main Street and still bind to the object property.

Thanks

Carl

 

Dinko | Tech Support Engineer
Telerik team
 answered on 28 Aug 2024
1 answer
191 views

I am using the RadMaskedEditBox to limit the user input. I need to allow the user to enter values from 0.0 to 999.9.  I was using a MaskType of Standard with a Mask of 999.9 or ###.#...however, this is forcing the user to enter numbers that are < 100 as 099.0. The users down't want to enter 0 for any value below 100, this is a real pain for them. so, I switched it to using a MaskType of Numeric and setting the Mask to N1, but this has its own problem of allowing the user to enter 9999999.9, which when saved, thows an error (the underline field is only 5 characters).  Since there is no MaxLenth field on this control, I need a better method.   I looked at using REGEX as the masktype, but, to this date, I still struggle with REGEX EXPRESSIONS and how to create an REGEX Expression to make this work.  Anyone help me out here. 

 

Thanks.

Dinko | Tech Support Engineer
Telerik team
 answered on 28 Jul 2023
1 answer
111 views

Never did this before, but I need to make a custom change to a control that will affect all instances of it throughout the application. If the user clicks in a masked edit control at any position and the control is empty, the cursor should jump to position 1. It works fine when I use the event handler of the control directly like this:

 private void mtbHomePhone_Click(object sender, EventArgs e)
        {
            if (mtbHomePhone.Value?.ToString()?.Length == 0)
            {
                mtbHomePhone.SelectionStart = 1;
                mtbHomePhone.SelectionLength = 0;
            }
        }

 

I'm trying to inherit from the control like this (using MyMaskedEdit in the designer.cs in place of RadMaskedEditBox) but the event is not firing. What am I doing wrong?

using Telerik.WinControls.UI;

namespace VisionUI.Common
{
    public class MyMaskedEdit : RadMaskedEditBox
    {
        protected override void OnClick(EventArgs e)
        {
            base.OnClick(e);

            if (this.Value?.ToString()?.Length == 0)
            {
                this.SelectionStart = 1;
                this.SelectionLength = 0;
            }
        }
    }
}

 

Thanks

Carl

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 May 2023
1 answer
950 views

Hi,

I'm getting weird / unexpected behaviour when using the masked edit box configured to handle IP Addresses.

So using the latest Demo Application, I open up the Masked Edit Box, and in the IP edit box I type in 11.22.33.44

I then double click and highlight the 44 part, and type 6 to replace the 44 with a single 6, however the following is displayed

After clicking on OK this then changes to show the ip address as 11.22.33.255 It seems that clicking on 6 does not replace the 44 but gets inserted at the start of the element. Is there a workaround for this behaviour ?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 15 Dec 2022
1 answer
93 views
Hello Team,

In our application, we are using RadMaskedEditbox for the Phone and Fax values.

We are using the property for MaskType is Standard & Mask is (###) ###-#### & & & & & & & &

Here we need to allow only the numeric value, not special characters. (Do not allow them to enter the hyphen.)

The problem is: https://prnt.sc/xsW5oONnZLN4

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 May 2022
1 answer
151 views

Hi.  I want to bring a custom control that inherits from RasMaskedEditBox. But onKeyDown and OnKeyPress events do not fired.

public class myMask: Radmaskededitbox

{

protected override void OnKeyDown(KeyEventArgs e)

{

//My codes

}

}

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 05 May 2021
1 answer
109 views

Hi Team,

   When click or double click in the field and the full number doesn't get highlighted on the RadMaskedEditbox.

 

Video Link : https://ttprivatenew.s3.amazonaws.com/pulse/suganya-gmail/attachments/16655538/TinyTake24-04-2021-01-52-14.mp4

We need to load the Phone number Textbox value as 713-000-0000 ("(###) ###-####") while loading but when i try to enter the value the RadMaskedEditbox value it should allow to type 18 characters ((###) ###-############)

 

Nadya | Tech Support Engineer
Telerik team
 answered on 26 Apr 2021
2 answers
138 views
How can you set so that the text is not lit when the control receives the focus?
Eusebio
Top achievements
Rank 1
Veteran
 answered on 16 Dec 2020
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?