its my first question in StackOverFlow ,
I have a text box , when clicking on,it shows a context menu , I have some control (user control or ..) in context menu.
everything is ok except in mouse over , all my controls get focus and their background change to blue , its so awful, another problem , in context menu , there is an vertical line , and an Icon place in left of it , How Can I remove it ?
C# Code :
private void textBox1_GotMouseCapture(object sender, MouseEventArgs e)
{
textBox1.ContextMenu.PlacementTarget = textBox1;
textBox1.ContextMenu.IsOpen = true;
textBox1.Focus();
}
和《刑法》:
<TextBox Height="23" HorizontalAlignment="Left" Margin="12,55,0,0"
Name="textBox1" VerticalAlignment="Top"
Width="120" MouseDown="textBox1_MouseDown"
GotMouseCapture="textBox1_GotMouseCapture"
ContextMenuService.HasDropShadow="False"
ContextMenuService.ShowOnDisabled="True"
TextChanged="textBox1_TextChanged">
<TextBox.ContextMenu>
<ContextMenu Name="ctm" Placement="Relative"
Focusable="False" HasDropShadow="False"
VerticalOffset="23" HorizontalOffset="0">
<StackPanel Margin="0" >
<TextBox Text="testing..." Name="testing"></TextBox>
</StackPanel>
</ContextMenu>
</TextBox.ContextMenu>
</TextBox>
感谢大家。