Click here to Skip to main content
15,914,413 members
Home / Discussions / C#
   

C#

 
GeneralRe: Marshalling MyStruct[] from C# to C++ API Pin
Daniel Turini4-Apr-05 8:24
Daniel Turini4-Apr-05 8:24 
Generalreferencing a control on another form Pin
kornstyle4-Apr-05 7:08
kornstyle4-Apr-05 7:08 
GeneralRe: referencing a control on another form Pin
tdciDoug4-Apr-05 7:36
tdciDoug4-Apr-05 7:36 
GeneralRe: referencing a control on another form Pin
Luis Alonso Ramos4-Apr-05 7:53
Luis Alonso Ramos4-Apr-05 7:53 
GeneralRe: referencing a control on another form Pin
kornstyle4-Apr-05 8:26
kornstyle4-Apr-05 8:26 
QuestionWrite a format provider ?? Pin
Ray-v4-Apr-05 5:59
Ray-v4-Apr-05 5:59 
AnswerRe: Write a format provider ?? Pin
Luis Alonso Ramos4-Apr-05 15:07
Luis Alonso Ramos4-Apr-05 15:07 
GeneralWindow State Pin
Finn Grimwood4-Apr-05 5:51
Finn Grimwood4-Apr-05 5:51 
GeneralRe: Window State Pin
Tom Larsen4-Apr-05 10:29
Tom Larsen4-Apr-05 10:29 
GeneralRe: Window State Pin
Finn Grimwood6-Apr-05 2:48
Finn Grimwood6-Apr-05 2:48 
GeneralCustom control Property error..... Pin
chettu4-Apr-05 5:00
chettu4-Apr-05 5:00 
QuestionCase insensitive string replace WITHOUT regex? Pin
mav.northwind4-Apr-05 4:46
mav.northwind4-Apr-05 4:46 
General[C# / ASP.net] Reading / Moving objects within Listbox Pin
Jaymz6664-Apr-05 3:38
Jaymz6664-Apr-05 3:38 
GeneralRe: [C# / ASP.net] Reading / Moving objects within Listbox Pin
Judah Gabriel Himango4-Apr-05 4:33
sponsorJudah Gabriel Himango4-Apr-05 4:33 
QuestionHow to get audio level from the microphone Pin
maberk4-Apr-05 3:36
maberk4-Apr-05 3:36 
GeneralProgram Interruption From External Messagebox Pin
Black Dhalia4-Apr-05 3:06
Black Dhalia4-Apr-05 3:06 
GeneralDouble Click Pin
Simon Wren4-Apr-05 3:00
professionalSimon Wren4-Apr-05 3:00 
GeneralRe: Double Click Pin
Claudio Grazioli4-Apr-05 3:23
Claudio Grazioli4-Apr-05 3:23 
Define your MyEventArgs class and inherit from EventArgs:

public class MyEventArgs : EventArgs
{
  String _myString = String.Empty;

  public MyEventArgs(String aString)
  {
    _myString = aString;
  }

  public string MyString
  {
    get { return _myString; }
    set { _myString = value; }
  }
}


In the user control, override the OnDoubleClick() method and "replace" the EventArgs with your own MyEventArgs:

protected override void OnDoubleClick(EventArgs e)
{ 
  MyEventArgs args = new MyEventArgs("MyEventArgs");
  base.OnDoubleClick(args);
}


In your main form, listen to the DoubleClick event and typecast the EventArgs back to MyEventArgs:

private void MyControlDoubleClicked(object sender, EventArgs e)
{
  MyEventArgs args = (MyEventArgs)e;
  MessageBox.Show(args.MyString);
}


hth

Claudio
Claudio's Website
GeneralRe: Double Click Pin
Simon Wren4-Apr-05 23:52
professionalSimon Wren4-Apr-05 23:52 
GeneralRe: Double Click Pin
_eulogy_4-Apr-05 11:09
_eulogy_4-Apr-05 11:09 
GeneralRe: Double Click Pin
Claudio Grazioli4-Apr-05 20:33
Claudio Grazioli4-Apr-05 20:33 
GeneralRe: Double Click Pin
_eulogy_4-Apr-05 23:30
_eulogy_4-Apr-05 23:30 
GeneralUSB and Framework 2.0 Pin
Snowjim4-Apr-05 0:01
Snowjim4-Apr-05 0:01 
GeneralRe: USB and Framework 2.0 Pin
Judah Gabriel Himango4-Apr-05 4:30
sponsorJudah Gabriel Himango4-Apr-05 4:30 
GeneralRe: USB and Framework 2.0 Pin
eggie54-Apr-05 13:32
eggie54-Apr-05 13:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.