Click here to Skip to main content
16,014,613 members
Home / Discussions / C#
   

C#

 
GeneralRe: Cursor position Pin
XRaheemX7-Oct-05 10:14
XRaheemX7-Oct-05 10:14 
AnswerRe: Cursor position Pin
Wjousts7-Oct-05 7:07
Wjousts7-Oct-05 7:07 
GeneralRe: Cursor position Pin
XRaheemX7-Oct-05 7:21
XRaheemX7-Oct-05 7:21 
QuestionCustom Controls and events Pin
Red_Wizard_Shot_The_Food7-Oct-05 3:46
Red_Wizard_Shot_The_Food7-Oct-05 3:46 
AnswerRe: Custom Controls and events Pin
XRaheemX7-Oct-05 5:37
XRaheemX7-Oct-05 5:37 
GeneralRe: Custom Controls and events Pin
Red_Wizard_Shot_The_Food7-Oct-05 5:56
Red_Wizard_Shot_The_Food7-Oct-05 5:56 
GeneralRe: Custom Controls and events Pin
XRaheemX7-Oct-05 6:55
XRaheemX7-Oct-05 6:55 
GeneralRe: Custom Controls and events Pin
therealmccoy7-Oct-05 5:50
therealmccoy7-Oct-05 5:50 
I'm not a dot net guru, but I had a similar issue and will share.

I created a control that creates a SQL statement based upon user selections. I needed an event that would fire when the SQL was generated. I first declared the following:

public delegate void SQLCreatedHandler();
[Category("Action")]
[Description("Fires when the SQL is created")]
public event SQLCreatedHandler SQLCreated;

When I wanted to fire the event I called this code:

//Raise event notifying subscribers that the SQL has been created
OnSQLCreated();

And the OnSQLCreated() method looked like this:
// If an event has no subscribers registerd, it will
// evaluate to null. The test checks that the value is not
// null, ensuring that there are subsribers before
// calling the event itself.
if (SQLCreated != null)
{
SQLCreated(); // Notify Subscribers
}

From the hosting application I created a handler for the event:
this.queryControl1.SQLCreated += new QueryControl.QueryControl.SQLCreatedHandler(this.queryControl1_SQLCreated);

And the method for the handler:

private void queryControl1_SQLCreated()
{
MessageBox.Show(this.queryControl1.SQL);
}

Hope this helps, don't mind the codeing. I found the articles here on CP that helped me create the above code. Search the articles, not messageboards





www.lovethosetrains.com
QuestionSystem.Diagnostic.Process question/problem Pin
XRaheemX7-Oct-05 3:28
XRaheemX7-Oct-05 3:28 
AnswerRe: System.Diagnostic.Process question/problem Pin
therealmccoy7-Oct-05 7:59
therealmccoy7-Oct-05 7:59 
GeneralRe: System.Diagnostic.Process question/problem Pin
XRaheemX7-Oct-05 8:02
XRaheemX7-Oct-05 8:02 
GeneralRe: System.Diagnostic.Process question/problem Pin
therealmccoy7-Oct-05 8:57
therealmccoy7-Oct-05 8:57 
Questionaccessing a C DLL with C# Long/Int problem Pin
CalvinB7-Oct-05 3:26
CalvinB7-Oct-05 3:26 
AnswerRe: accessing a C DLL with C# Long/Int problem Pin
mav.northwind7-Oct-05 4:15
mav.northwind7-Oct-05 4:15 
GeneralRe: accessing a C DLL with C# Long/Int problem Pin
CalvinB7-Oct-05 4:59
CalvinB7-Oct-05 4:59 
GeneralRe: accessing a C DLL with C# Long/Int problem Pin
leppie7-Oct-05 7:25
leppie7-Oct-05 7:25 
QuestionData Access & Tab Control Pin
rich_wenger7-Oct-05 2:49
rich_wenger7-Oct-05 2:49 
QuestionSoftware Architecture - HELP! Pin
trjones17-Oct-05 1:44
trjones17-Oct-05 1:44 
AnswerRe: Software Architecture - HELP! Pin
Dan Neely7-Oct-05 2:04
Dan Neely7-Oct-05 2:04 
AnswerRe: Software Architecture - HELP! Pin
Carl Mercier7-Oct-05 4:47
Carl Mercier7-Oct-05 4:47 
Questionconverting array of byte to string in c# Pin
TssPrasad7-Oct-05 1:16
sussTssPrasad7-Oct-05 1:16 
AnswerRe: converting array of byte to string in c# Pin
Andrew Kirillov7-Oct-05 1:34
Andrew Kirillov7-Oct-05 1:34 
GeneralRe: converting array of byte to string in c# Pin
tssp7-Oct-05 2:12
tssp7-Oct-05 2:12 
QuestionLDAP Pin
ramenk6-Oct-05 23:45
ramenk6-Oct-05 23:45 
AnswerRe: LDAP Pin
ehuysamer7-Oct-05 2:25
ehuysamer7-Oct-05 2:25 

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.