Tuesday, February 25, 2014

How to override defualt textbox context menu in windows store c#

doesnt look like you can extend the contextmenu but you can override it, Use the ContextMenuOpening event



private void TextBox_ContextMenuOpening(object sender, ContextMenuEventArgs e)
{
e.Handled = true;

Popup f = new Popup();
f.IsLightDismissEnabled = true;
f.Child = new Border
{
Background = new SolidColorBrush(Colors.CadetBlue),
Width = 200,
Height = 100
};

f.VerticalOffset = e.CursorTop;
f.HorizontalOffset = e.CursorLeft;

f.IsOpen = true;



}





Microsoft Certified Solutions Developer - Windows Store Apps Using C#


No comments:

Post a Comment