首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 媒体动画 > CAD教程 >

silverlight 五开发【vb版】(5)-鼠标左右键事件

2012-09-12 
silverlight 5开发【vb版】(5)-鼠标左右键事件Partial Public Class MainPageInherits UserControlPrivate c

silverlight 5开发【vb版】(5)-鼠标左右键事件

Partial Public Class MainPage    Inherits UserControl    Private currentlocation As Point    Public Sub New()        InitializeComponent()    End Sub    Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click        Label1.Content = "您好," & TextBox1.Text & "!"    End Sub    Private Sub LayoutRoot_MouseMove(sender As System.Object, e As System.Windows.Input.MouseEventArgs) Handles LayoutRoot.MouseMove        currentlocation = e.GetPosition(LayoutRoot)        Label2.Content = "现在鼠标的坐标是:(" & currentlocation.X.ToString() & "," & currentlocation.Y.ToString() & ")"    End Sub    Private Sub LayoutRoot_MouseLeftButtonDown(sender As System.Object, e As System.Windows.Input.MouseButtonEventArgs) Handles LayoutRoot.MouseLeftButtonDown        MessageBox.Show("您按了左键")    End Sub    Private Sub LayoutRoot_MouseRightButtonDown(sender As System.Object, e As System.Windows.Input.MouseButtonEventArgs) Handles LayoutRoot.MouseRightButtonDown        MessageBox.Show("您按了右键")    End SubEnd Class

?

MouseLeftButtonDown和MouseRightButtonDown事件是左键和右键处理事件


silverlight 五开发【vb版】(5)-鼠标左右键事件
?

热点排行