文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > 高等教育 > 工学 > 稳扎稳打Silverlight(5) - 2.0控件之ListBox, MultiScaleImage, PasswordBox, ProgressBar, RadioButton
侵权投诉

稳扎稳打Silverlight(5) - 2.0控件之ListBox, MultiScaleImage, PasswordBox, ProgressBar, RadioButton

this.msi.MouseLeave += delegate(object

稳扎稳打Silverlight(5) - 2.0控件之ListBox, MultiScaleImage, PasswordBox, ProgressBar, RadioButton

sender, MouseEventArgs e) { mouseIsDragging = false; };

稳扎稳打Silverlight(5) - 2.0控件之ListBox, MultiScaleImage, PasswordBox, ProgressBar, RadioButton

this.MouseLeftButtonUp += delegate(object

稳扎稳打Silverlight(5) - 2.0控件之ListBox, MultiScaleImage, PasswordBox, ProgressBar, RadioButton

sender, MouseButtonEventArgs e) { mouseButtonPressed = false; if (mouseIsDragging == false)

稳扎稳打Silverlight(5) - 2.0控件之ListBox, MultiScaleImage, PasswordBox, ProgressBar, RadioButton

{ bool shiftDown = (Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift;

稳扎稳打Silverlight(5) - 2.0控件之ListBox, MultiScaleImage, PasswordBox, ProgressBar, RadioButton

ZoomFactor = 2.0;

if (shiftDown) ZoomFactor = 0.5;

Zoom(ZoomFactor, this.lastMousePos);

}

mouseIsDragging = false;

};

this.MouseMove += delegate(object sender, MouseEventArgs e)

{

if (mouseIsDragging)

{

Point newOrigin = new Point();

newOrigin.X = currentPosition.X - (((e.GetPosition(msi).X - dragOffset.X) / msi.ActualWidth) * msi.ViewportWidth);

newOrigin.Y = currentPosition.Y - (((e.GetPosition(msi).Y - dragOffset.Y) / msi.ActualHeight) * msi.ViewportWidth);

msi.ViewportOrigin = newOrigin;

}

};

new MouseWheelHelper(this).Moved += delegate(object sender,

MouseWheelEventArgs e)

{

e.Handled = true;

if (e.Delta >0)

ZoomFactor = 1.2;

else

ZoomFactor = .80;

Zoom(ZoomFactor, this.lastMousePos);

};

上一页第7页

你可能喜欢

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email