Questions tagged [eventargs]

Represents the base class for classes that contain event data, and provides a value to use for events that do not include event data.

Represents the base class for classes that contain event data, and provides a value to use for events that do not include event data.

This class serves as the base class for all classes that represent event data. For example, the System.AssemblyLoadEventArgs class derives from EventArgs and is used to hold the data for assembly load events. To create a custom event data class, create a class that derives from the EventArgs class and provide the properties to store the necessary data. The name of your custom event data class should end with EventArgs.

http://msdn.microsoft.com/en-us/library/system.eventargs(v=vs.110).aspx

164 questions
0
votes
2 answers

Passing information from javascript to C# using events

I have this ASP.net component: and I'd like to send some additional information to this SubmitData method, implemented in C#. For…
Jeremy
  • 5,365
  • 14
  • 51
  • 80
0
votes
1 answer

EventArgs data usage

I have three classes, the FileManagerClass contains two events which are EventHandler FileMove and EventHandler FileMoveError. I then have a custom EventArgs class named FileTransferEventArg that…
Recht88
  • 113
  • 1
  • 1
  • 9
0
votes
0 answers

C# events with custom arguments - how to achieve something similar with C++?

Is it possible to achieve in C++ similar behavior to that of events with custom arguments in C#? I came across the following link: https://www.tangiblesoftwaresolutions.com/articles/cplus_equivalent_to_csharp_events.html Can that idea be applied to…
Al2110
  • 566
  • 9
  • 25
0
votes
1 answer

Is there a checkedListBox ItemUnchecked/CheckChanged event of some kind?

I know that there is a checkedListBox event called ItemChecked and I think there's a CheckChanged event for individual checkboxes, but is there an ItemUnchecked or CheckChanged event counterpart for a checkedListBox? If so, how would I subscribe to…
Isaac
  • 51
  • 1
  • 9
0
votes
0 answers

How To get position of cursor on panel with scrollbars

I am using C# winforms and have a panel that scrolls that I would like to detect the coordinates of a mouse click within the panel in relation to the panel. I am simply trying to get the coordinates and print them out for now. There is already…
N.Dance
  • 11
  • 3
0
votes
2 answers

What is the type of MouseEventArgs.X?

Working with C# in Visual Studio 2008 (.NET 3.5). Looking into System.Windows.Forms.MouseEventArgs. I'm seeing strange behavior with long Panel when I intercept handle the MouseMove event. It appears that MouseEventArgs.X goes from 0 to 32767, and…
John
  • 15,990
  • 10
  • 70
  • 110
0
votes
0 answers

Wpf Priority of EventArgs

When I pushed slider which children of Grid I want to childrens eventargs should trigger before Grid.I want to e.handled true after my grids children triggered. How do I do this. Thanks for interest. Here is my grids mousedown public void…
ORHAN TOPDAĞ
  • 157
  • 1
  • 1
  • 11
0
votes
3 answers

How to check for "method group" via "sender" object?

Imagine a method like this ( in Win Forms): //First method private void buttonStart_Click(object sender, EventArgs e) { //I call another method here this.GetData(sender, null) } //Second method private void GetData(object sender,…
Dumbo
  • 13,555
  • 54
  • 184
  • 288
0
votes
2 answers

Trying to use KeyPress with arguments but don't know how to pass args correcly

I want the program to exit when I press Escape, the way it is right now, just close whenever a press anybutton. Here is my code game.KeyPress += (sender, e) => { game.Exit(); }; I using https://github.com/ppy/osuTK this as reference in my…
0
votes
1 answer

Helix Toolkit How to use MouseWheelEventHandler to run specific methods in other classes

I would like to run particular methods of a custom Camera class whenever the user zooms in or out in the helix toolkit view that my program is running inside of. A key feature of this functionality is getting the mouseargs from the event so I can…
0
votes
1 answer

Event Arguments Best Practice and Updating Issues

Can I update only selected variables within a custom EventArgs class or do I need to update all of them at the same time? For instance when this method is called: public void updateEvents(string var1, string var2, string var3) { // reference…
CraigJSte
  • 912
  • 6
  • 17
  • 33
0
votes
1 answer

Are EventArgs thread safe on .NET CF WinCE

I'm trying to maintain some horrible VB to get concurrency. I want to delegate some Maths code to a thread and have it raise an event with EventArgs which contains a structure with the information with which to update a form. In the UI event…
Nick
  • 358
  • 2
  • 13
0
votes
1 answer

Getting EventArgs in a calling class

I have a class that calls another class - the new class has events that I have defined for it. I am subscribed to the events in my calling class but my calling class does not seem to be able to get the EventArgs. I know I must be doing something…
Ken
  • 2,518
  • 2
  • 27
  • 35
0
votes
1 answer

VB.NET AddHandler for programmatically created object

I have this code to move with my forms. Public BeingDragged As Boolean = False Public MouseDownX As Integer Public MouseDownY As Integer Private Sub Mouse_Down(sender As Object, e As MouseEventArgs) If e.Button = MouseButtons.Left Then …
Skulaurun Mrusal
  • 2,792
  • 1
  • 15
  • 29
0
votes
1 answer

C# override event with custom eventargs

I need a custom NumericUpDown where the event ValueChanged should pass CancelEventArgs instead of EventArgs as I want to be able to cancel the editing when certain conditions are verified (e.g. I have two NumericUpDown that must have always…
PrinceOfBorgo
  • 508
  • 5
  • 14