技术开发 频道

如何在silverlihgt中使用右键


【IT168技术文档】

  添加一个<TextBlock>到Page.xaml中
<UserControl x:Class="rightClick.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="400" Height="300"> <Grid x:Name="LayoutRoot" Background="White"> <TextBlock x:Name="MyField">Right click please.</TextBlock> </Grid> </UserControl>
  在页面中设置silverlight的参数Windowless="true"
<asp:Silverlight ID="Silverlight1" runat="server" Height="480px" MinimumVersion="2.0.30523" Source="~/ClientBin/rightClick.xap" Windowless="true" Width="640px" /> <object data="data:application/x-silverlight," type="application/x-silverlight-2-b2" width="100%" height="100%"> <param name="source" value="ClientBin/rightClick.xap"/> <param name="onerror" value="onSilverlightError" /> <param name="background" value="white" /> <param name="Windowless" value="true" /> <a href="http://go.microsoft.com/fwlink/?LinkID=115261" style="text-decoration: none;"> <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/> </a> </object>
0
相关文章