本文整理汇总了C#中System.Windows.Input.Cursor类的典型用法代码示例。如果您正苦于以下问题:C# Cursor类的具体用法?C# Cursor怎么用?C# Cursor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Cursor类属于System.Windows.Input命名空间,在下文中一共展示了Cursor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OverrideCursor
/// <summary>
/// Temporarily overrides mouse cursor for the entire application.
/// </summary>
/// <param name="newCursor">The new cursor to be used.</param>
/// <returns>The reference to the <see cref="System.IDisposable"/> object
/// restoring current mouse cursor upon call to the
/// <see cref="M:System.IDisposable.Dispose"/> method.</returns>
public static IDisposable OverrideCursor(Cursor newCursor)
{
var currentCursor = Mouse.OverrideCursor;
Mouse.OverrideCursor = newCursor;
return new DelegateDisposable(() => Mouse.OverrideCursor = currentCursor);
}
开发者ID:erindm,项目名称:route-planner-csharp,代码行数:14,代码来源:MouseHelper.cs
示例2: SetTemplate
public void SetTemplate(DataTemplate template)
{
if (template != null)
{
if (_cursorContainer != null)
{
var content = _cursorContainer.Child as ContentControl;
if (content != null)
{
content.ContentTemplate = template;
}
if (!_cursorContainer.IsOpen)
{
_element.MouseLeave += element_MouseLeave;
_element.MouseMove += element_MouseMove;
_cursorContainer.IsOpen = true;
_originalCursor = _element.Cursor;
_element.Cursor = Cursors.None;
}
}
}
else
{
_element.MouseLeave -= element_MouseLeave;
_element.MouseMove -= element_MouseMove;
_cursorContainer.IsOpen = false;
_element.Cursor = _originalCursor;
}
}
开发者ID:chris-tomich,项目名称:Glyma,代码行数:32,代码来源:SuperCursor.cs
示例3: ShowStatusProgressbar
//in App Main Window stausbar
//Shows Progressbar in statusbar
private void ShowStatusProgressbar()
{
Window1 window = LifetimeService.Instance.Container.Resolve<Window1>();//27Oct2014
//window.ProgressStatusPanel.Visibility = Visibility.Visible;
defaultcursor = Mouse.OverrideCursor;
Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
}
开发者ID:BlueSkyStatistics,项目名称:BlueSkyRepository,代码行数:9,代码来源:RefreshDatagridCommand.cs
示例4: MouseLeftButtonDown
/// <summary>
/// Override of <see cref="BehaviourBase"/> that handles a left mouse button press.
/// This initiates the point move process allowing a user to alter the Y value of
/// the selected point.
/// </summary>
/// <param name="position">The position on the mouse on click.</param>
public override void MouseLeftButtonDown(Point position)
{
// Get the point that has been clicked on.
GetSelectedPoint(position);
// Check we can capture the mouse, otherwise the move is impossible.
bool captured = BehaviourContainer.CaptureMouse();
if (captured && _selectedPoint != null)
{
_leftMouseDown = true;
SetZoomEnabled(false);
foreach(var child in this.BehaviourContainer.Children)
{
if(child is ZoomBehaviour)
{
(child as ZoomBehaviour).IsEnabled = false;
break;
}
}
// Change the point style by adding it to the Series SelectedItems list
//((ChartSingleSeriesBase)Chart.Series[0]).SelectedItems.Add(_selectedPoint);
// Change the cursor
_currentCursor = Chart.Cursor;
Chart.Cursor = Cursors.Hand;
}
}
开发者ID:Redacacia,项目名称:FreePIE,代码行数:38,代码来源:MovePointBehaviour.cs
示例5: MapAction
/// <summary>${ui_action_MapAction_constructor_Map_D}</summary>
/// <param name="map">${ui_action_MapAction_constructor_Map_param_map}</param>
/// <param name="name">${ui_action_MapAction_constructor_Map_param_name}</param>
/// <param name="cursor">${ui_action_MapAction_constructor_Map_param_cursor}</param>
protected MapAction(Map map, string name, Cursor cursor)
{
Name = name;
Map = map;
Map.Cursor = cursor;
Map.Focus();
}
开发者ID:SuperMap,项目名称:iClient-for-Silverlight,代码行数:11,代码来源:MapAction.cs
示例6: OverrideCursor
public OverrideCursor(Cursor changeToCursor)
{
_stack.Push(changeToCursor);
if (Mouse.OverrideCursor != changeToCursor) {
Mouse.OverrideCursor = changeToCursor;
}
}
开发者ID:kehh,项目名称:biolink,代码行数:7,代码来源:OverrideCursor.cs
示例7: BuildAdornerCorner
private Thumb BuildAdornerCorner(Cursor cursor, DragDeltaEventHandler dragHandler)
{
var thumb = new Thumb();
// TODO: this thumb should be styled to look like a dotted triangle,
// similar to the one you can see on the bottom right corner of
// Internet Explorer window
thumb.Cursor = cursor;
thumb.Height = thumb.Width = 10;
thumb.Opacity = 0.40;
thumb.Background = new SolidColorBrush(Colors.MediumBlue);
thumb.DragDelta += dragHandler;
thumb.DragStarted += (s, e) => {
var handler = ResizeStarted;
if (handler != null) {
handler(this, e);
}
};
thumb.DragCompleted += (s, e) => {
var handler = ResizeCompleted;
if (handler != null) {
handler(this, e);
}
};
_visualChildren.Add(thumb);
return thumb;
}
开发者ID:TerabyteX,项目名称:main,代码行数:26,代码来源:ResizingAdorner.cs
示例8: PreprocessMouseDown
public override void PreprocessMouseDown(MouseButtonEventArgs e)
{
if (SettingsProvider.IsMiddleClickScrollEnabled() == false)
return;
if (this._location.HasValue)
{
this.StopScrolling();
e.Handled = true;
}
else
{
if (e.ChangedButton != MouseButton.Middle || this._view.IsClosed || (!this._view.VisualElement.IsVisible || !this._view.VisualElement.CaptureMouse()))
return;
this._oldCursor = this._view.VisualElement.Cursor;
this._view.VisualElement.Cursor = Cursors.ScrollAll;
Point position = e.GetPosition((IInputElement)this._view.VisualElement);
this._location = new Point?(this._view.VisualElement.PointToScreen(position));
if (this._zeroPointImage == null)
{
BitmapSource bitmapSourceFromHicon = Imaging.CreateBitmapSourceFromHIcon(User32.LoadImage(IntPtr.Zero, new IntPtr(32654), 2U, 0, 0, 40960U), Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
bitmapSourceFromHicon.Freeze();
this._zeroPointImage = new Image();
this._zeroPointImage.Source = (ImageSource)bitmapSourceFromHicon;
this._zeroPointImage.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
this._zeroPointImage.Opacity = 0.5;
}
Canvas.SetLeft((UIElement)this._zeroPointImage, this._view.ViewportLeft + position.X - this._zeroPointImage.DesiredSize.Width * 0.5);
Canvas.SetTop((UIElement)this._zeroPointImage, this._view.ViewportTop + position.Y - this._zeroPointImage.DesiredSize.Height * 0.5);
this._layer.AddAdornment(AdornmentPositioningBehavior.ViewportRelative, new SnapshotSpan?(), (object)null, (UIElement)this._zeroPointImage, (AdornmentRemovedCallback)null);
this._lastMoveTime = DateTime.Now;
this._moveTimer = new DispatcherTimer(new TimeSpan(0, 0, 0, 0, 25), DispatcherPriority.Normal, new EventHandler(this.OnTimerElapsed), this._view.VisualElement.Dispatcher);
this._dismissOnMouseUp = false;
e.Handled = true;
}
}
开发者ID:gramcha,项目名称:XFeatures,代码行数:35,代码来源:MiddleClickScroll.cs
示例9: SoheilSingularView
public SoheilSingularView(ISingularList viewModel, List<Tuple<string, AccessType>> accessList, Cursor openCursor, Cursor closeCursor)
{
InitializeComponent();
ViewModel = viewModel;
AccessList = accessList;
_openCursor = openCursor;
_closeCursor = closeCursor;
}
开发者ID:T1Easyware,项目名称:Soheil,代码行数:8,代码来源:SoheilSingularView.xaml.cs
示例10: dragWindow
void dragWindow(object sender, MouseButtonEventArgs e)
{
//Change cursor
Cursor closedhand = new Cursor(new System.IO.MemoryStream(ArduinoMonitor.Resources.closedhand));
dragBar.Cursor = closedhand;
this.DragMove();
}
开发者ID:DiLRandI,项目名称:ArduinoMonitor,代码行数:8,代码来源:MainWindow.xaml.cs
示例11: PolygonWaveFormControl
public PolygonWaveFormControl()
{
this.SizeChanged += OnSizeChanged;
InitializeComponent();
XScale = 2;
defaultCursor = Cursor;
this.DataContext = this;
}
开发者ID:CaffeineAU,项目名称:TTSTranslator,代码行数:8,代码来源:PolygonWaveFormControl.xaml.cs
示例12: CursorSwitcher
public CursorSwitcher(Cursor cursor)
{
_previousCursor =Mouse.OverrideCursor ;
if ( cursor == null )
Mouse.OverrideCursor =Cursors.Wait ;
else
Mouse.OverrideCursor =cursor ;
}
开发者ID:Narinyir,项目名称:Maya-Net-Wpf-DarkScheme,代码行数:8,代码来源:CursorSwitcher.cs
示例13: WordView
public WordView()
{
InitializeComponent();
ListBox.AddHandler(MouseLeftButtonDownEvent, new MouseButtonEventHandler((sender, args) => args.Handled = false), true);
StreamResourceInfo closedhand = System.Windows.Application.GetResourceStream(new Uri("Images/closedhand.cur", UriKind.Relative));
Debug.Assert(closedhand != null);
_closedHandCursor = new Cursor(closedhand.Stream);
}
开发者ID:rmunn,项目名称:cog,代码行数:8,代码来源:WordView.xaml.cs
示例14: button4_Click
private void button4_Click(object sender, RoutedEventArgs e)
{
// 현재는 오류남
// x2c2.ani를 프로젝트에 추가하고, 빌드작업을 resource로 설정
// 12장 참고
StreamResourceInfo sri = Application.GetContentStream(new Uri("x2c2.ani", UriKind.Relative));
Cursor customerCursor = new Cursor(sri.Stream);
this.Cursor = customerCursor;
}
开发者ID:TigerKim,项目名称:testRepo,代码行数:9,代码来源:MainWindow.xaml.cs
示例15: OverrideCursor
public OverrideCursor(Cursor changetoCursor)
{
_stack.Push(changetoCursor);
if (changetoCursor != null && Mouse.OverrideCursor != changetoCursor)
{
Mouse.OverrideCursor = changetoCursor;
}
}
开发者ID:Techide,项目名称:DMC,代码行数:9,代码来源:OverrideCursor.cs
示例16: PresenterItem
public PresenterItem(ElementBase element)
: base(element)
{
Cursor = null;
ShowBorderOnMouseOver = false;
IsEnabled = true;
IsPoint = false;
IsVisibleLayout = !element.IsHidden;
}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:9,代码来源:PresenterItem.cs
示例17: MainWindow
public MainWindow()
{
InitializeComponent();
var curPath = Path.Combine(Environment.CurrentDirectory, "crayon.cur");
var cursor = new Cursor(curPath);
blkTop.Background = _background;
icvMain.Background = _background;
icvMain.Cursor = cursor;
}
开发者ID:CuteITGuy,项目名称:ProgrammerUtilitiesCOOL,代码行数:9,代码来源:MainWindow.xaml.cs
示例18: Crosshair
public Crosshair()
{
InitializeComponent();
// dragger.Source = imgCrosshair;
using (MemoryStream memStream = new MemoryStream(Properties.Resources.crosshair))
{
myCursor = new System.Windows.Input.Cursor(memStream);
}
}
开发者ID:YashMaster,项目名称:GestureSign,代码行数:9,代码来源:Crosshair.xaml.cs
示例19: WaitCursor
public WaitCursor()
{
Application.Current.Dispatcher.Invoke(() =>
{
_previousCursor = Mouse.OverrideCursor;
Mouse.OverrideCursor = Cursors.Wait;
InstanceCounter++;
});
}
开发者ID:Ttxman,项目名称:NanoTrans,代码行数:9,代码来源:WaitCursor.cs
示例20: MainWindow
public MainWindow()
{
InitializeComponent();
if (string.IsNullOrEmpty(Path)) return;
txt_Directory.Text = Path;
_originalMediaMargin = media.Margin;
_originalBackground = Background;
_originalCursor = Cursor;
Reset();
}
开发者ID:bjennings76,项目名称:Giffer,代码行数:10,代码来源:MainWindow.xaml.cs
注:本文中的System.Windows.Input.Cursor类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论