本文整理汇总了C#中MouseEventHandler类的典型用法代码示例。如果您正苦于以下问题:C# MouseEventHandler类的具体用法?C# MouseEventHandler怎么用?C# MouseEventHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MouseEventHandler类属于命名空间,在下文中一共展示了MouseEventHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ColorButton
public ColorButton()
{
MouseEnter += new EventHandler(OnMouseEnter);
MouseLeave += new EventHandler(OnMouseLeave);
MouseUp += new MouseEventHandler(OnMouseUp);
Paint += new PaintEventHandler(ButtonPaint);
}
示例2: InitializeEvents
/// <summary>
/// Initialize class events.
/// </summary>
private void InitializeEvents()
{
TextChanged += new EventHandler(HandleTextChanged);
UpdateUI += new EventHandler<UpdateUIEventArgs>(HandleUpdateUI);
// enable drag & drop
AllowDrop = true;
DragOver += new DragEventHandler(HandleDragOver);
DragDrop += new DragEventHandler(HandleDragDrop);
// search & replace
KeyUp += new KeyEventHandler(HandleKeyUp);
KeyDown += new KeyEventHandler(HandleKeyDown);
InsertCheck += new EventHandler<InsertCheckEventArgs>(HandleInsertCheck);
CharAdded += new EventHandler<CharAddedEventArgs>(HandleCharAdded);
MouseWheel += new MouseEventHandler(HandleMouseWheel);
Painted += new EventHandler<EventArgs>(HandlePainted);
// create default pens
grayPen = new Pen(Brushes.Gray);
dashedPen = new Pen(Brushes.LightGray);
dashedPen.DashPattern = new[] { 3f, 6f };
// measure default line size
lineSize = TextRenderer.MeasureText(new string('/', NewLineHelper), Font);
}
示例3: SharpDevelopSideBar
public SharpDevelopSideBar()
{
SideTabItemFactory = new SharpDevelopSideTabItemFactory();
MouseUp += new MouseEventHandler(SetContextMenu);
sideTabContent.MouseUp += new MouseEventHandler(SetItemContextMenu);
}
示例4: Init
private void Init()
{
InitializeComponent();
MouseUp += new MouseEventHandler(OnMouseUp);
KeyUp += new KeyEventHandler(OnKeyUp);
}
示例5: OnMouseLeftButtonDown
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
//因为图钉是添加在MapLayer上的
var parentLayer = this.Parent as MapLayer;
if (parentLayer != null)
{
//MapLayer是Map的一个子对象
var parentMap = parentLayer.ParentMap;
if (parentMap != null)
{
if (this.MapMouseDragHandler == null)
{
this.MapMouseDragHandler = new EventHandler<MapMouseDragEventArgs>(ParnetMap_MousePan);
parentMap.MousePan += this.MapMouseDragHandler;
}
if (this.MapMouseLeftButtonUpHandler == null)
{
this.MapMouseLeftButtonUpHandler = new MouseButtonEventHandler(PrentMap_MouseLeftButtonUp);
parentMap.MouseLeftButtonUp += this.MapMouseLeftButtonUpHandler;
}
if (this.MapMouseMoveHandler == null)
{
this.MapMouseMoveHandler = new MouseEventHandler(PrentMap_MouseMove);
parentMap.MouseMove += this.MapMouseMoveHandler;
}
}
}
this.IsDragging = true;
base.OnMouseLeftButtonDown(e);
}
示例6: VoiceToolstripButton
public VoiceToolstripButton(VoiceService voices)
{
Voices = voices;
ToolTipText = "Voice Chat";
Paint += new PaintEventHandler(VoiceToolstripButton_Paint);
ButtonClick += new EventHandler(VoiceToolstripButton_ButtonClick);
MouseDown += new MouseEventHandler(VoiceToolstripButton_MouseDown);
MouseUp += new MouseEventHandler(VoiceToolstripButton_MouseUp);
OffButton = new ToolStripMenuItem("Off", Res.VoiceRes.VoiceOff, OffButton_Clicked);
VoiceActivatedButton = new ToolStripMenuItem("Voice Activated", Res.VoiceRes.VoiceVAD, VoiceActivatedButton_Clicked);
PushtoTalkButton = new ToolStripMenuItem("Push to Talk", Res.VoiceRes.VoicePTT, PushtoTalkButton_Clicked);
MuteButton = new ToolStripMenuItem("Mute", Res.VoiceRes.VoiceMute, MuteButton_Clicked);
SettingsButton = new ToolStripMenuItem("Settings", Res.VoiceRes.VoiceSettings, SettingsButton_Clicked);
DropDownItems.Add(OffButton);
DropDownItems.Add(VoiceActivatedButton);
DropDownItems.Add(PushtoTalkButton);
DropDownItems.Add(MuteButton);
DropDownItems.Add(SettingsButton);
WindowID = Voices.Core.RndGen.Next();
Voices.RegisterWindow(WindowID, new VolumeUpdateHandler(VoiceService_VolumeUpdate));
OffButton.PerformClick();
}
示例7: FormMoveHook
public FormMoveHook(Form target)
{
form = target;
mouseDownHandler = new MouseEventHandler(MouseDownHandler);
mouseUpHandler = new MouseEventHandler(MouseUpHandler);
mouseMoveHandler = new MouseEventHandler(MouseMovHandlere);
}
示例8: FractalView
public FractalView()
{
fractalImageCacheInvalidated = true;
MouseClick += new MouseEventHandler(GAPictureBox_Click);
Paint += new PaintEventHandler(GAPanel_Paint);
}
示例9: InitializeForm
private void InitializeForm()
{
var mouseDoubleClick = new MouseEventHandler((sender, args) => { Process.Start((sender as TextBox).Text); });
this.txtSourceRootDir.MouseDoubleClick += mouseDoubleClick;
this.txtSourceRootDir2.MouseDoubleClick += mouseDoubleClick;
this.txtSourceRootDir3.MouseDoubleClick += mouseDoubleClick;
// Attach handler
ProcessBehavior.PrintLog += AddLog;
DbBehavior.PrintLog += AddLog;
// set the command line args.
var commandLineArgs = Environment.GetCommandLineArgs();
if (commandLineArgs.Count() == 3)
{
if (commandLineArgs[1].ToUpper() == "QA")
{
tabControl1.SelectedIndex = 1;
this.txtSourceRootDir.Text = commandLineArgs[2];
}
}
// QA 탭 감춤.
tabControl1.SelectedTab.Visible = false;
cboLanguage.SelectedIndex = 1;
cbxClientCount.SelectedIndex = 0;
cbxEnvironment.SelectedIndex = 0;
//if (Screen.AllScreens.Length > 1)
//{
// this.Location = new Point(Screen.AllScreens[1].WorkingArea.X, Screen.AllScreens[1].WorkingArea.Height - this.Height);
//}
}
示例10: MainForm
public MainForm()
{
InitializeComponent();
MouseEventHandler wheelHandler = null;
wheelHandler = new MouseEventHandler(listBox_MouseWheel);
eventListBox.MouseWheel += wheelHandler;
}
示例11: ImageButton
public ImageButton()
{
MouseMove += new MouseEventHandler(ImageButton_MouseMove);
MouseDown += new MouseEventHandler(ImageButton_MouseDown);
MouseLeave += new EventHandler(ImageButton_MouseLeave);
MouseUp += new MouseEventHandler(ImageButton_MouseUp);
}
示例12: InitializeAutoC
public void InitializeAutoC()
{
// auto completion settings
AutoCSeparator = '|';
AutoCMaxHeight = 9;
MouseMove += new MouseEventHandler(HandleMouseMove);
}
示例13: StartCapture
/// <summary>
/// 开始鼠标捕捉
/// </summary>
/// <param name="element"></param>
/// <param name="mouseMoveHandler"></param>
/// <param name="mouseUpHandler"></param>
public static void StartCapture(this FrameworkElement element, MouseEventHandler mouseMoveHandler,
MouseButtonEventHandler mouseUpHandler)
{
element.MouseMove += mouseMoveHandler;
element.MouseUp += mouseUpHandler;
element.CaptureMouse();
}
示例14: TriangleRegion
public TriangleRegion(Image backgroundImage = null)
: base(backgroundImage)
{
Angle = TriangleAngle.Top;
MouseWheel += new MouseEventHandler(TriangleRegion_MouseWheel);
}
示例15: DragPictureBox
Dictionary<string, int> heldValues = new Dictionary<string, int>(); // Used to store a dictionary of held values which can be used by developers to attatch values to this DragPictureBox
#endregion Fields
#region Constructors
// When a new instance of a DragPictureBox is created
public DragPictureBox()
{
InitializeComponent(); // Initialize this DragPictureBox component
followMouse.Tick += new EventHandler(followMouse_Tick); // Add the listener to the followMouse timer so that when it ticks it calls the followMouse_Tick method
followMouse.Interval = 10; // Set the interval of the followMouse timer to 10 milliseconds
MouseDown += new MouseEventHandler(MouseClicked); // Add a MouseDown listener to this DragPictureBox to call MouseClicked when the user clicks it.
}