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)
{
}
}