本文整理汇总了C#中MouseButtonEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# MouseButtonEventArgs类的具体用法?C# MouseButtonEventArgs怎么用?C# MouseButtonEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MouseButtonEventArgs类属于命名空间,在下文中一共展示了MouseButtonEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MouseButtonUp
public override void MouseButtonUp(MouseButtonEventArgs args)
{
if (PointInside (args.X, args.Y)) {
Console.WriteLine ("Activating!");
OnActivate ();
}
}
示例2: OnListBoxDoubleClick
private void OnListBoxDoubleClick(object sender, MouseButtonEventArgs args)
{
var listBoxItem = args.Source as System.Windows.Controls.ListBoxItem;
if (listBoxItem != null && CanDoubleClick(listBoxItem))
{
ListBoxDoubleClick(listBoxItem);
}
}
示例3: OnListBoxDoubleClick
private void OnListBoxDoubleClick(object sender, MouseButtonEventArgs args)
{
var listBoxItem = args.Source as RadListBoxItem;
if (listBoxItem != null && CanDoubleClick(listBoxItem))
{
ListBoxDoubleClick(listBoxItem);
}
}
示例4: Mouse
public Mouse( IWindow window )
{
w = window.Handle as OpenTK.GameWindow;
w.Mouse.ButtonDown += Mouse_ButtonDown;
w.Mouse.ButtonUp += Mouse_ButtonUp;
w.Mouse.Move += Mouse_Move;
w.Mouse.WheelChanged += Mouse_WheelChanged;
buttonEvent = new MouseButtonEventArgs ( GetState () );
wheelEvent = new MouseWheelEventArgs ( 0 );
}
示例5: CommandsButton_MouseDown
// ======================================================
private void CommandsButton_MouseDown(object sender, MouseButtonEventArgs e)
{
if (((Button) sender).Text == "Show Commands") {
((Button) sender).Text = "Hide Commands";
commandsLabel.Visible = true;
}
else {
((Button) sender).Text = "Show Commands";
commandsLabel.Visible = false;
}
}
示例6: OnCharacterSelect
/// <summary>
/// Since character selection at the moment is the final stage in the menus, this loads the new level based on the previous
/// level selection and current character selection
/// </summary>
void OnCharacterSelect(Button button, MouseButtonEventArgs eventArgs, string characterSelection)
{
if (LKernel.Get<MainMenuUIHandler>().GameType == GameTypeEnum.SinglePlayer) {
this.characterSelection = characterSelection;
LevelChangeRequest request = new LevelChangeRequest() {
NewLevelName = levelSelection,
CharacterNames = new string[] { characterSelection },
IsMultiplayer = false,
};
LKernel.GetG<LevelManager>().LoadLevel(request);
}
}
示例7: Mouse
public Mouse( IWindow window )
{
this.window = window;
Form w = window.Handle as Form;
w.MouseDown += ButtonDownEvent;
w.MouseUp += ButtonUpEvent;
w.MouseMove += MoveEvent;
w.MouseWheel += WheelEvent;
w.MouseHover += HoverEvent;
w.MouseLeave += LeaveEvent;
buttonEvent = new MouseButtonEventArgs ( new MouseState () );
wheelEvent = new MouseWheelEventArgs ( 0 );
}
示例8: MouseEventToKeyName
string MouseEventToKeyName(MouseButtonEventArgs e)
{
if (e.Button == MouseButton.PrimaryButton)
{
return "leftmousebutton";
}
if (e.Button == MouseButton.MiddleButton)
{
return "middlemousebutton";
}
if (e.Button == MouseButton.SecondaryButton)
{
return "rightmousebutton";
}
return "";
}
示例9: btnAccept_Click
void btnAccept_Click(object sender, MouseButtonEventArgs e)
{
Messenger.SendAddSignRequest(txtHouse1.Text, txtHouse2.Text, txtHouse3.Text);
MenuSwitcher.CloseAllMenus();
Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
}
示例10: AllowMouseLeftButtonDown
/// <summary>
/// Check if the control's MouseLeftButtonDown event should be handled.
/// </summary>
/// <param name="e">Event arguments.</param>
/// <returns>
/// A value indicating whether the event should be handled.
/// </returns>
public bool AllowMouseLeftButtonDown(MouseButtonEventArgs e)
{
if (e == null)
{
throw new ArgumentNullException("e");
}
bool enabled = Control.IsEnabled;
if (enabled)
{
// Get the current position and time
DateTime now = DateTime.UtcNow;
Point position = e.GetPosition(Control);
// Compute the deltas from the last click
double timeDelta = (now - LastClickTime).TotalMilliseconds;
Point lastPosition = LastClickPosition;
double dx = position.X - lastPosition.X;
double dy = position.Y - lastPosition.Y;
double distance = dx * dx + dy * dy;
// Check if the values fall under the sequential click temporal
// and spatial thresholds
if (timeDelta < SequentialClickThresholdInMilliseconds &&
distance < SequentialClickThresholdInPixelsSquared)
{
ClickCount++;
}
else
{
ClickCount = 1;
}
// Set the new position and time
LastClickTime = now;
LastClickPosition = position;
// Raise the event
IsPressed = true;
}
else
{
ClickCount = 1;
}
return enabled;
}
示例11: onScrollBack
public void onScrollBack(object sender, MouseButtonEventArgs e)
{
Value -= SmallIncrement;
}
示例12: MouseButtonUp
public override void MouseButtonUp(MouseButtonEventArgs args)
{
if (PointInside (args.X, args.Y))
OnActivate ();
}
示例13: Events_MouseButtonUp
void Events_MouseButtonUp(object sender, MouseButtonEventArgs e)
{
if (MouseUp != null)
{
MouseUp(sender, e);
}
}
示例14: btnMyHouse_Click
void btnMyHouse_Click(object sender, MouseButtonEventArgs e)
{
Messenger.SendHouseVisitRequest(Players.PlayerManager.MyPlayer.Name);
MenuSwitcher.CloseAllMenus();
Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
}
示例15: MainPage_MouseLeftButtonUp
void MainPage_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
// If the Canvas containing the TextBox is visible, ignore
// this event.
/*
if (TextBoxCanvas.Visibility == Visibility.Visible)
{
return;
}
// Save the location where the user touched the screen.
pointOnScreen = e.GetPosition(LayoutRoot);
// Save the device attitude when the user touched the screen.
attitude = motion.CurrentValue.Attitude.RotationMatrix;
// Make the Canvas containing the TextBox visible and
// give the TextBox focus.
TextBoxCanvas.Visibility = Visibility.Visible;
txtName.Focus();
*/
}