tags:

views:

87

answers:

2

Hello,

In the WPF Code

<Button Click="onClick">
  <TextBlock>
    <Hyperlink >Click Me!</Hyperlink>
  </TextBlock>
</Button>

How do I stop the HyperLink from receiving mouse events? I don't want it to highlight, change cursor or anything.

Thanks in advance! James

+1  A: 

You can't do it in the XAML but you can do it in code by setting an event handler for every mouse event you don't want processed and mark the event as already being handled which should stop it going any further.

private void OnClickHandler(object sender, RoutedEventArgs e)
{
    e.Handled = true; 
}
sipwiz
+1  A: 

OK,

I did a Google search for you, and found this link for you.

Chris
Thanks -- I settled on <Button><TextBlock Foreground="Blue" TextDecorations="Underline" >Hello2</TextBlock></Button>
James