製造WPF Link Label

March 9, 2014 at 12:43 PMAdmin

 

WPF沒有Link Label的元件,不過,可以用TextBlock加Hyperlink

<TextBlock Grid.Row="2"  Name="lblButtom">
		<Hyperlink NavigateUri="" Click="lnkAds_Click" Name="lnkAds">Ads:Stellar Phoenix Windows Data Recovery - Pro</Hyperlink>
		
	 </TextBlock>.
NavigateUri可以不用著,儘管按著元件也沒有反應。
因為欠了Click Event:
public void lnkAds_Click(object sender, RoutedEventArgs e)
		{
System.Diagnostics.Process.Start("URL");}

 

Posted in: C#

Tags:

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading