dotnet / dotnet/dotnet-api-docs
Winform Masked Textbox causes ModifiedChanged event to not fire
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
If I set a mask value the ZipcodeTextbox MaskedTextbox control it will result in the event not firing. In the code below I can comment out the mask setting and the event will fire. I have even tried to set the mask on the ZipcodeTextbox the same as the SupportPhoneTextbox and still the event will not fire. I have confirmed the TextChanged event does fire.
Any suggestions or pointing me towards an answer is greatly appreciated.
//
// SupportPhoneTextbox
//
this.SupportPhoneTextbox.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.SupportPhoneTextbox.Location = new System.Drawing.Point(410, 46);
this.SupportPhoneTextbox.Mask = "(999) 000-0000";
this.SupportPhoneTextbox.Name = "SupportPhoneTextbox";
this.SupportPhoneTextbox.Size = new System.Drawing.Size(114, 23);
this.SupportPhoneTextbox.TabIndex = 31;
this.SupportPhoneTextbox.TextMaskFormat = System.Windows.Forms.MaskFormat.ExcludePromptAndLiterals;
this.SupportPhoneTextbox.TextChanged += new EventHandler(SupportPhoneTextbox_ModifiedChanged);
//
// ZipcodeTextbox
//
this.ZipcodeTextbox.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ZipcodeTextbox.Location = new System.Drawing.Point(74, 126);
this.ZipcodeTextbox.Name = "ZipcodeTextbox";
this.ZipcodeTextbox.Mask = "00000-9999";
this.ZipcodeTextbox.Size = new System.Drawing.Size(83, 23);
this.ZipcodeTextbox.TabIndex = 34;
this.ZipcodeTextbox.TextMaskFormat = System.Windows.Forms.MaskFormat.ExcludePromptAndLiterals;
this.ZipcodeTextbox.ModifiedChanged += new EventHandler(ZipcodeTextbox_ModifiedChanged);
Contributor guide
Assessment
This issue has not been assessed yet.