稳扎稳打Silverlight(46) - 4.0UI之FlowDirection, TextTrimming, 响应鼠标滚轮事件, 响应鼠标右键事件, 全屏的新特性...

稳扎稳打Silverlight(46) - 4.0UI之FlowDirection, TextTrimming, 响应鼠标滚轮事件, 响应鼠标右键事件, 全屏的新特性
2010年08月23日
  [b] 稳扎稳打Silverlight(46) - 4.0UI之FlowDirection, TextTrimming, 响应鼠标滚轮事件, 响应鼠标右键事件, 全屏的新特性 [/b][b]收藏 [/b]
  稳扎稳打Silverlight(46) - 4.0UI之FlowDirection, TextTrimming, 响应鼠标滚轮事件, 响应鼠标右键事件, 全屏的新特性
  作者:webabcd
  介绍
  Silverlight 4.0 用户界面(UI)相关:
  FlowDirection - 指定文本或界面元素在它们的父元素中的流动方向
  TextTrimming - 文字溢出时的显示方式
  响应鼠标的滚轮事件
  响应鼠标的右键事件
  全屏的新特性 - 当其他程序获得焦点时,是否退出全屏模式
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  ComboBox 这类的控件,如果出现了垂直滚动条的话,则可以通过滚动鼠标滚轮的方法来控制该滚动条
  -->
  
  
  
  
  
  
  
  
  
  
  ComboBox Name="comboBox" VerticalAlignment="Top" Width="100" Height="20" MaxDropDownHeight="200" />
  
  
  
  
  
  
  
  
  
  
  
  
  /*
  * 本例演示如何响应鼠标滚轮事件
  * UIElement.MouseWheel - 鼠标滚轮滚动时所触发的事件
  * MouseWheelEventArgs.Delta - 滚轮向上滚动为正数;滚轮向下滚动为负数
  */
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Net;
  using System.Windows;
  using System.Windows.Controls;
  using System.Windows.Documents;
  using System.Windows.Input;
  using System.Windows.Media;
  using System.Windows.Media.Animation;
  using System.Windows.Shapes;
  using System.Windows.Navigation;
  namespace Silverlight40.UI
  {
  public partial class MouseWheel : Page
  {
  public MouseWheel()
  {
  InitializeComponent();
  }
  protected override void OnNavigatedTo(NavigationEventArgs e)
  {
  List list = new List();
  for (int i = 0; i
  
  
  
  
  
  
  
  
  
  /*
  * 本例演示如何响应鼠标右键事件
  * UIElement.MouseRightButtonDown - 鼠标右键按下时所触发的事件
  * UIElement.MouseRightButtonUp - 鼠标右键抬起时所触发的事件
  */
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Net;
  using System.Windows;
  using System.Windows.Controls;
  using System.Windows.Documents;
  using System.Windows.Input;
  using System.Windows.Media;
  using System.Windows.Media.Animation;
  using System.Windows.Shapes;
  using System.Windows.Navigation;
  namespace Silverlight40.UI
  {
  public partial class MouseRightClick : Page
  {
  public MouseRightClick()
  {
  InitializeComponent();
  }
  protected override void OnNavigatedTo(NavigationEventArgs e)
  {
  button.MouseRightButtonDown += new MouseButtonEventHandler(button_MouseRightButtonDow n);
  button.MouseRightButtonUp += new MouseButtonEventHandler(button_MouseRightButtonUp) ;
  }
  void button_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
  {
  lblMsg.Text = "鼠标右键 Down";
  e.Handled = true;
  }
  void button_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
  {
  lblMsg.Text = "鼠标右键 Up";
  e.Handled = true;
  }
  }
  }
  
  
  
  
  
  
  
  /*
  * Application.Current.Host.Content.FullScreenOptions - 全屏的选项
  * System.Windows.Interop.FullScreenOptions.None - 当其他程序获得焦点时,退出全屏模式(默认值)
  * System.Windows.Interop.FullScreenOptions.StaysFull ScreenWhenUnfocused - 当其他程序获得焦点时,保持全屏模式
  * 当设置为“StaysFullScreenWhenUnfocused”全屏时会弹出对话框,要求用户确认是否使用“StaysFullScreenWhenUnfocused”的全屏模式。如果程序是“被信任的应用程序”则不会弹出该对话框
  */
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Net;
  using System.Windows;
  using System.Windows.Controls;
  using System.Windows.Documents;
  using System.Windows.Input;
  using System.Windows.Media;
  using System.Windows.Media.Animation;
  using System.Windows.Shapes;
  using System.Windows.Navigation;
  namespace Silverlight40.UI
  {
  public partial class FullScreen : Page
  {
  public FullScreen()
  {
  InitializeComponent();
  }
  protected override void OnNavigatedTo(NavigationEventArgs e)
  {
  }
  private void btnFullScreen_Click(object sender, RoutedEventArgs e)
  {
  Application.Current.Host.Content.FullScreenOptions = System.Windows.Interop.FullScreenOptions.StaysFull ScreenWhenUnfocused;
  Application.Current.Host.Content.IsFullScreen ^= true;
  }
  }
  }
  type="text/javascript"> if ($ != jQuery) { $ = jQuery.noConflict(); }
  发表于 @ 2010年08月23日 08:02:00 |
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值