I apologize for being vague and unclear. I need to assign the MouseClick event because I'm trying to capture a right mouse click on all labels, buttons, dropdownlists, and maskedEditBoxes. I'm able to use this with buttons, dropdownlists, and labels, but not the masked edit box.
If you consider the following code, There isn't MouseClick event for this.radMaskedEditBox1.MaskedEditBoxElement.TextBoxItem so I've tried using the MouseUp event. However that fails with the following invalid cast type exception: "Unable to cast object of type 'Telerik.WinControls.UI.RadTextBoxItem' to type System.Windows.Forms.Control'."
Now using this.radMaskedEditBox1.MouseClick will work, however the user has to click on the small border line to fire the event and isn't the desired action.
Lastly, I've tried this.radMaskedEditBox1.MaskedEditBoxElement.TextBoxItem.HostedControl.MouseClick, however left mouse clicks will fire the event, but not right.
This should be more helpful to the issue at hand.
sender, EventArgs e)
//Runtime Error: Invalid Cast
//Closest to working, but doesn't fire with right mouse click
//Doesn't fire on the textbox, only the border
sender, MouseEventArgs e)
Control c = (Control)sender;
"Clicked On "
+ c.GetType() +
" using a "
+ (e.Button == MouseButtons.Right ?
Thanks for the help,