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
1 answer

How do I respond on a form to events being triggered in a class?

I'm going through my code and redoing all my events so they are in compliance with this article but I've run into a wall. Here's my code: Script.cs public EventHandler Load; protected virtual void OnLoad(string file) { …
duck
  • 747
  • 14
  • 31
0
votes
2 answers

Cannot implicitly convert type 'System.EventHandler' to xxxxCompletedEventHandler

I'm trying do some smart event handling in C#, but I'm stuck with an error message saying : Cannot implicitly convert type 'System.EventHandler' to xxxxCompletedEventHandler I have a piece of code that looks like this : _ServiceAgentArt.Test((s,e)…
ThomasE
  • 369
  • 1
  • 5
  • 19
0
votes
1 answer

how to deal with multiple event args

I am in the process of creating a small game. The engine will have a number of events that the GUI can subscribe to. The events are: ballselected balldeselected ballmoved ballremoved This would all be fine if I only had one type of ball, but…
Jon
  • 15,110
  • 28
  • 92
  • 132
0
votes
1 answer

use e.rowindex and e.columnindex outside the datagridview events

In a method I want to use dataGridView1.Rows[e.RowIndex] and dataGridView1.Rows[e.ColumnIndex] How can I use e.RowIndex and e.ColumnIndex outside the private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) can we…
codemirror
  • 3,164
  • 29
  • 42
0
votes
3 answers

Problems with, or best practices for, passing data back through eventargs?

I've got a non-GUI class that generates events as to what it is doing (which are in turn used by a Form to display to the user the progress). One of the events is a AboutToDoSomethingDestructiveEvent. Now we want to have the Form display a dialog…
Robert Gowland
  • 7,677
  • 6
  • 40
  • 58
0
votes
1 answer

KeyEventArgs and MouseEventArgs

I'm trying to make a button that handles both enters and clicks. I've set up my sub procedure to handle both keyups and mouse clicks, however I cannot access MouseEventArgs from EventrArs nor KeyEventArgs from System.EventArgs. How can I do such?
Uriel Katz
  • 319
  • 1
  • 8
  • 21
0
votes
1 answer

how can i add event args? if i add inside System.EventHandler( , ) i get an error

how can i add event args? if i add inside System.EventHandler( , ) i get an error. class RadioButtonChecked: EventArgs { private int m_ButtonNumber; public RadioButtonChecked(int num) { m_ButtonNumber = num; } public…
Aviram Shiri
  • 173
  • 1
  • 2
  • 9
0
votes
1 answer

Can you set EventArgs from ASP.NET controls?

I have a DropDownList whose SelectedIndexChanged event I set: move.SelectedIndexChanged += Move; public void Move(object sender, EventArgs e) { } I'd like to create a class derived from EventArgs which is the argument "e" that gets passed to the…
Petras
  • 4,686
  • 14
  • 57
  • 89
0
votes
2 answers

Using event arguments in portable class library

I'm currently developing an application for both Windows 8 and Windows Phone 8. The building of the views has to be very dynamic, so I have to use a lot of datatemplates for this. In these data templates I use the Galasoft MVVMLight EventToCommand…
0
votes
1 answer

when we need to pass nullptr to an object^ or EventArgs ? and why to pass EventArgs::Empty to EventArgs^?

I have a method in my code, it's name is bindingSource_PositionChanged. the definition of it is: private: System::Void bindingSource_PositionChanged(**System::Object^ sender, System::EventArgs^ e**) { toolStripStatusLabel->Text =…
0
votes
2 answers

C# Event Argument passing

Ok, so I have a question regarding the EventArgs that can be passed when an event is triggered. I am designing a small, basic search engine and have a class called Query that contains a method Search. When this method is called, I want to trigger an…
Wes Field
  • 3,291
  • 6
  • 23
  • 26
0
votes
1 answer

Why does Microsoft use new EventHandler when connecting to an event

Suppose I have a class that logs errors (ErrorLog). Every time an error is added to the log this class will raise an event (ErrorLog.EventErrorAdded) to notify observers that a new error is added to the log. This event has some data…
Harald Coppoolse
  • 28,834
  • 7
  • 67
  • 116
0
votes
4 answers

EventHandler with FormClosingEventArgs - C#

I have this closing form code in my Form.cs public void label7_Click(object sender, FormClosingEventArgs e) { MessageBox.Show("Are you sure you want to exit?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if…
user2393874
  • 70
  • 1
  • 8
0
votes
3 answers

Getting the value from a dynamic NumericUpDown by Sender c#

I've ran into quite an annoying problem. I've got these global variables (for keeping the name etc) List NumeriekVakken = new List(); List bedragenLijst = new List(); List
Yenthe
  • 2,313
  • 5
  • 26
  • 46
0
votes
1 answer

LinkButton not accessing EventArg

I am using c#.net. I am trying to create a LinkButton within the code-behind, when I debug my code I recieve no errors, however its not accessing the EventArg attached to the button, it does however refresh the page. What am I doing wrong? Button…
ClareBear
  • 1,493
  • 6
  • 25
  • 47
1 2 3
10
11