Click here to Skip to main content
15,900,906 members
Home / Discussions / C#
   

C#

 
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 
GeneralTriggering on SQL events originating from third-party application Pin
Trickster-SWE3-Apr-05 23:43
Trickster-SWE3-Apr-05 23:43 
GeneralDesigner changes control size during build Pin
engine2523-Apr-05 22:55
engine2523-Apr-05 22:55 
GeneralRe: Designer changes control size during build Pin
leppie4-Apr-05 1:16
leppie4-Apr-05 1:16 
GeneralRe: Designer changes control size during build Pin
engine2524-Apr-05 2:43
engine2524-Apr-05 2:43 
QuestionGet and set desktop image in C#? Pin
Sabry19053-Apr-05 22:46
Sabry19053-Apr-05 22:46 
AnswerRe: Get and set desktop image in C#? Pin
Judah Gabriel Himango4-Apr-05 4:23
sponsorJudah Gabriel Himango4-Apr-05 4:23 
GeneralVB.Net To C# Pin
rathishps3-Apr-05 21:05
rathishps3-Apr-05 21:05 
GeneralRe: VB.Net To C# Pin
Seraphin3-Apr-05 21:41
Seraphin3-Apr-05 21:41 
Generalcrystalreport Pin
itssuk3-Apr-05 19:58
itssuk3-Apr-05 19:58 
Generali, Pin
itssuk3-Apr-05 19:55
itssuk3-Apr-05 19:55 

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.