473,324 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Why use Events?

What are reasons to create your own events? Why not just call a class
method/function instead?

Thanks,
Brett
Nov 21 '05 #1
18 2691
Because a method or function has to be explicitly called. An even occurs
when something within the application happens by itself, or as a result of
something, like an error condition, or a timer event being fired. .
Also, consider a piece of code (A) that controls another piece of code(B).
How would B notify A that something has happened. It has no concept of what
has created it, and therefore cannot instigate the communication.

"Brett" <no@spam.com> wrote in message
news:us**************@TK2MSFTNGP09.phx.gbl...
What are reasons to create your own events? Why not just call a class
method/function instead?

Thanks,
Brett

Nov 21 '05 #2
The way I use them ususally.

Events are for intimation.

An Object intimating a class for some event.

You cant by regular means call a method of the class that has instantiated
the object from within the object.
Events help in this case and make life easy.

HTH
rawCoder

"Brett" <no@spam.com> wrote in message
news:us**************@TK2MSFTNGP09.phx.gbl...
What are reasons to create your own events? Why not just call a class
method/function instead?

Thanks,
Brett

Nov 21 '05 #3

"rawCoder" <ra******@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
The way I use them ususally.

Events are for intimation.

An Object intimating a class for some event.

You cant by regular means call a method of the class that has instantiated
the object from within the object.
Can you show a code example of what you mean here?
Events help in this case and make life easy.

HTH
rawCoder

"Brett" <no@spam.com> wrote in message
news:us**************@TK2MSFTNGP09.phx.gbl...
What are reasons to create your own events? Why not just call a class
method/function instead?

Thanks,
Brett


Nov 21 '05 #4

"JohnFol" <Ou************@WibbleObbble.Com> wrote in message
news:zH******************@newsfe6-win.ntli.net...
Because a method or function has to be explicitly called. An even occurs
when something within the application happens by itself, or as a result of
something, like an error condition, or a timer event being fired. .
Also, consider a piece of code (A) that controls another piece of code(B).
How would B notify A that something has happened. It has no concept of
what has created it, and therefore cannot instigate the communication.


What kind of thing may happen? try/catch can communicate errors but what
else are you referring to?
Nov 21 '05 #5
-----Original Message-----
What are reasons to create your own events? Why not just call a classmethod/function instead?

Thanks,
Brett
.

Generally, events are used to communicate an action, or
event, back to the parent object. Say you have a form
that needs to load a huge amount of data, and you use a
DLL for this, how is the Form going to know how much data
is loaded or if it's done? I'm sure you can write a
bunch of code, or do some fancy threading, but, in the
DLL, make an event that is triggered, and the Form
handles this event. Think of an event as a simple
callback system. Events aren't necessary, but I haven't
seen a really good program out there that doesn't use
events.
Nov 21 '05 #6
Hi, I use them in usercontrols for example I've got a usercontrol with a
combobox on it and some more controls.
The combobox is filled with customers, and when I choose one the other
controls on the usercontrol get filled but I also want to notify the form
where my usercontrol is on. So in my usercontrol I code:

Public Event Customer(ByVal CustomerName as String)

and then when the comboxs' selectedindex changes I call my event like this
RaiseEvent Customer("MyCustomerName")

Next, on the form where the usercontrol is placed I can select the
usercontrol in the code editor (left combo) and select it's event Customer
(right combo) and I get something like this and can set my form.text to the
CustomerName

Private Sub UserControl1_Customer(ByVal CustomerName As String) Handles
UserControl1.Customer
me.Text = CustomerName
end sub

hth Peter


"Brett" <no@spam.com> schreef in bericht
news:#a**************@TK2MSFTNGP09.phx.gbl...

"rawCoder" <ra******@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
The way I use them ususally.

Events are for intimation.

An Object intimating a class for some event.

You cant by regular means call a method of the class that has instantiated the object from within the object.


Can you show a code example of what you mean here?
Events help in this case and make life easy.

HTH
rawCoder

"Brett" <no@spam.com> wrote in message
news:us**************@TK2MSFTNGP09.phx.gbl...
What are reasons to create your own events? Why not just call a class
method/function instead?

Thanks,
Brett



Nov 21 '05 #7
"Brett" <no@spam.com> wrote in message
news:us**************@TK2MSFTNGP09.phx.gbl...
What are reasons to create your own events? Why not just call a class
method/function instead?


Brett,

To call a Class method, you have to "know about" the Class and
what method(s) it has that you can actually call. That means your
Event-raising class would have to know, when written, about
every other class that might, possibly, ever instantiate it. (It's like
saying that Our Friends in Redmond "knew" about every [Form]
class we could ever write that might want to use a TextBox.
Clearly not feasible.

You could, of course, use an Interface or ancestor class, pass a
reference to an object of /that/ Type to your Event-raising Class
and call a [known] method of /that/ but, again, you have to have
the Interface or ancestor class before you can construct your
Event-raising class.

When a class raises an Event, it simply doesn't /care/ who or what
it's raising that Event /to/ (if, indeed, there's anything out there
handling the Event at all). The "caller" of the class can then choose
whether or not to handle each Event that might be raised (the caller
"knows about" the Events that the Event-raising class exposes).

HTH,
Phill W.
Nov 21 '05 #8
Brett,

I made a simple sample, does that explain something to you?

\\\Needs only a textbox and a button
Private WithEvents myfield As myRule
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
myfield = New myRule
myfield.Value = TextBox1.Text
End Sub
Private Sub myfield_Error(ByVal text As String) _
Handles myfield.Error
MessageBox.Show(text)
End Sub
End Class
Public Class myRule
Public Event [Error](ByVal text As String)
Private myValue As String
Public Property Value() As String
Get
End Get
Set(ByVal Value As String)
If Not IsNumeric(Value) Then RaiseEvent _
Error("The Value must be numeric, nothing is changed")
End Set
End Property
///

I hope this helps a little bit?

Cor
Nov 21 '05 #9

"Peter Proost" <pp*****@nospam.hotmail.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Hi, I use them in usercontrols for example I've got a usercontrol with a
combobox on it and some more controls.
The combobox is filled with customers, and when I choose one the other
controls on the usercontrol get filled but I also want to notify the form
where my usercontrol is on. So in my usercontrol I code:

Public Event Customer(ByVal CustomerName as String)

and then when the comboxs' selectedindex changes I call my event like this
RaiseEvent Customer("MyCustomerName")
But you could do a class Customer() method call here as well. What's the
difference?

Next, on the form where the usercontrol is placed I can select the
usercontrol in the code editor (left combo) and select it's event Customer
(right combo) and I get something like this and can set my form.text to
the
CustomerName

Private Sub UserControl1_Customer(ByVal CustomerName As String) Handles
UserControl1.Customer
me.Text = CustomerName
end sub

hth Peter


"Brett" <no@spam.com> schreef in bericht
news:#a**************@TK2MSFTNGP09.phx.gbl...

"rawCoder" <ra******@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
> The way I use them ususally.
>
> Events are for intimation.
>
> An Object intimating a class for some event.
>
> You cant by regular means call a method of the class that has instantiated > the object from within the object.


Can you show a code example of what you mean here?
> Events help in this case and make life easy.
>
> HTH
> rawCoder
>
> "Brett" <no@spam.com> wrote in message
> news:us**************@TK2MSFTNGP09.phx.gbl...
>> What are reasons to create your own events? Why not just call a class
>> method/function instead?
>>
>> Thanks,
>> Brett
>>
>>
>
>



Nov 21 '05 #10
"Brett" <no@spam.com> schrieb:
What are reasons to create your own events? Why not just call a class
method/function instead?


Visual Basic Language Concepts -- Events and Event Handlers
<URL:http://msdn.microsoft.com/library/en-us/vbcn7/html/vaconUnderstandingEventHandlers.asp>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #11
Consider a very simple example of a button sitting on a form. When the user
clicks the button how would the button let the form know it was clicked?
Yes. If the button had a reference to the form it COULD call a public
method. But the button does not know about it so the button raises a Clicked
event.

Also consider a situation in which two classes (say class A and class B)
have references to same instance of class C. If class C needs to announce
that something happened, how would he know who to tell. Maybe only class A
is interested or maybe both class A and B are intertested. It is better for
class C to just raise the event and whoever cares just listens for this
event to happen.

- Jason

"Brett" <no@spam.com> wrote in message
news:ep**************@TK2MSFTNGP14.phx.gbl...

"JohnFol" <Ou************@WibbleObbble.Com> wrote in message
news:zH******************@newsfe6-win.ntli.net...
Because a method or function has to be explicitly called. An even occurs
when something within the application happens by itself, or as a result
of something, like an error condition, or a timer event being fired. .
Also, consider a piece of code (A) that controls another piece of
code(B). How would B notify A that something has happened. It has no
concept of what has created it, and therefore cannot instigate the
communication.


What kind of thing may happen? try/catch can communicate errors but what
else are you referring to?

Nov 21 '05 #12
You are correct..you can write an application with a big while or do loop and
get input from the user then branch to different subs, funcitons, methods,
etc. That's what the original basic programming language did. However,
events will make your programming life much easier and more flexible if you
take the time to learn how to use them.

"Brett" wrote:

"Peter Proost" <pp*****@nospam.hotmail.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Hi, I use them in usercontrols for example I've got a usercontrol with a
combobox on it and some more controls.
The combobox is filled with customers, and when I choose one the other
controls on the usercontrol get filled but I also want to notify the form
where my usercontrol is on. So in my usercontrol I code:

Public Event Customer(ByVal CustomerName as String)

and then when the comboxs' selectedindex changes I call my event like this
RaiseEvent Customer("MyCustomerName")


But you could do a class Customer() method call here as well. What's the
difference?

Next, on the form where the usercontrol is placed I can select the
usercontrol in the code editor (left combo) and select it's event Customer
(right combo) and I get something like this and can set my form.text to
the
CustomerName

Private Sub UserControl1_Customer(ByVal CustomerName As String) Handles
UserControl1.Customer
me.Text = CustomerName
end sub

hth Peter


"Brett" <no@spam.com> schreef in bericht
news:#a**************@TK2MSFTNGP09.phx.gbl...

"rawCoder" <ra******@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
> The way I use them ususally.
>
> Events are for intimation.
>
> An Object intimating a class for some event.
>
> You cant by regular means call a method of the class that has

instantiated
> the object from within the object.

Can you show a code example of what you mean here?

> Events help in this case and make life easy.
>
> HTH
> rawCoder
>
> "Brett" <no@spam.com> wrote in message
> news:us**************@TK2MSFTNGP09.phx.gbl...
>> What are reasons to create your own events? Why not just call a class
>> method/function instead?
>>
>> Thanks,
>> Brett
>>
>>
>
>



Nov 21 '05 #13
I understand the form events because of user action but even with all of the
post to my thread, I still have a difficult time seeing where I would use a
custom event.

Perhaps relating it to something I'm working on will help. I use a while
loop with tcpclient and check if
networkStream = tcpClient.GetStream()
has anything. Can I create an event instead and put the while loop code in
it?

Thanks,
Brett

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
You are correct..you can write an application with a big while or do loop
and
get input from the user then branch to different subs, funcitons, methods,
etc. That's what the original basic programming language did. However,
events will make your programming life much easier and more flexible if
you
take the time to learn how to use them.

"Brett" wrote:

"Peter Proost" <pp*****@nospam.hotmail.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
> Hi, I use them in usercontrols for example I've got a usercontrol with
> a
> combobox on it and some more controls.
> The combobox is filled with customers, and when I choose one the other
> controls on the usercontrol get filled but I also want to notify the
> form
> where my usercontrol is on. So in my usercontrol I code:
>
> Public Event Customer(ByVal CustomerName as String)
>
> and then when the comboxs' selectedindex changes I call my event like
> this
> RaiseEvent Customer("MyCustomerName")


But you could do a class Customer() method call here as well. What's the
difference?
>
> Next, on the form where the usercontrol is placed I can select the
> usercontrol in the code editor (left combo) and select it's event
> Customer
> (right combo) and I get something like this and can set my form.text to
> the
> CustomerName
>
> Private Sub UserControl1_Customer(ByVal CustomerName As String) Handles
> UserControl1.Customer
> me.Text = CustomerName
> end sub
>
> hth Peter
>
>
>
>
> "Brett" <no@spam.com> schreef in bericht
> news:#a**************@TK2MSFTNGP09.phx.gbl...
>>
>> "rawCoder" <ra******@hotmail.com> wrote in message
>> news:%2***************@TK2MSFTNGP14.phx.gbl...
>> > The way I use them ususally.
>> >
>> > Events are for intimation.
>> >
>> > An Object intimating a class for some event.
>> >
>> > You cant by regular means call a method of the class that has
> instantiated
>> > the object from within the object.
>>
>> Can you show a code example of what you mean here?
>>
>> > Events help in this case and make life easy.
>> >
>> > HTH
>> > rawCoder
>> >
>> > "Brett" <no@spam.com> wrote in message
>> > news:us**************@TK2MSFTNGP09.phx.gbl...
>> >> What are reasons to create your own events? Why not just call a
>> >> class
>> >> method/function instead?
>> >>
>> >> Thanks,
>> >> Brett
>> >>
>> >>
>> >
>> >
>>
>>
>
>


Nov 21 '05 #14
Brett,

Do you have problems with your newsreader I see 4 not replied answers from
you, where at least mine answers this question from you,

Cor
Nov 21 '05 #15
So why not just put the code where you need it since this is only used in
one place:

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
myfield = New myRule
If Not IsNumeric(TextBox1.Text) Then
msgbox "The Value must be numeric, nothing is changed"
Else
myfield.Value = TextBox1.Text
End If
End Sub
"Cor Ligthert" <no************@planet.nl> wrote in message
news:uG*************@TK2MSFTNGP15.phx.gbl...
Brett,

I made a simple sample, does that explain something to you?

\\\Needs only a textbox and a button
Private WithEvents myfield As myRule
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
myfield = New myRule
myfield.Value = TextBox1.Text
End Sub
Private Sub myfield_Error(ByVal text As String) _
Handles myfield.Error
MessageBox.Show(text)
End Sub
End Class
Public Class myRule
Public Event [Error](ByVal text As String)
Private myValue As String
Public Property Value() As String
Get
End Get
Set(ByVal Value As String)
If Not IsNumeric(Value) Then RaiseEvent _
Error("The Value must be numeric, nothing is changed")
End Set
End Property
///

I hope this helps a little bit?

Cor

Nov 21 '05 #16
Hi Brett,

I have a class that handles all the Socket related stuff and receives data.
Now when some data is received it RAISES an EVENT so that the parent class
knows there was some data received.
So the parent class can like declare the object WithEvents and hence the
class implementing Socket operations doesnt need to know how to process the
data or the business logic while the parent class handles it.

Suppose you have a custom message queue with thread synchronisation.
Now if the queue has an event that gets raised at appropraite time when some
thing is added in it,
Then the caller doesnt need to do all the plumbing related to DeQueuing.
All it needs to do is declare the queue object and handle the data added
event.

One more way events are very very useful is for inter modular communication
as specified by someone else already in the thread.
Suppose you have a class 'E' which has one event declared in it and one
public method that raises the event.
Now class A has an instance of class E and calls the public mehtod which
raises the event.
Another Class B which also has the instance and handles the event, gets the
notification and the data associated.
The beauty is that the class 'E' never knew anything about 'A' or 'B'

Hope this makes sense to you more in terms of possible implementations where
custom events can be used.
I have implemented one way or another these scenarios in more or else the
same way.
So custom events are really very helpful.

Let us know what exaclty is your confusion now ?

HTH
rawCoder

"Brett" <no@spam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I understand the form events because of user action but even with all of the post to my thread, I still have a difficult time seeing where I would use a custom event.

Perhaps relating it to something I'm working on will help. I use a while
loop with tcpclient and check if
networkStream = tcpClient.GetStream()
has anything. Can I create an event instead and put the while loop code in it?

Thanks,
Brett

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
You are correct..you can write an application with a big while or do loop and
get input from the user then branch to different subs, funcitons, methods, etc. That's what the original basic programming language did. However,
events will make your programming life much easier and more flexible if
you
take the time to learn how to use them.

"Brett" wrote:

"Peter Proost" <pp*****@nospam.hotmail.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
> Hi, I use them in usercontrols for example I've got a usercontrol with > a
> combobox on it and some more controls.
> The combobox is filled with customers, and when I choose one the other > controls on the usercontrol get filled but I also want to notify the
> form
> where my usercontrol is on. So in my usercontrol I code:
>
> Public Event Customer(ByVal CustomerName as String)
>
> and then when the comboxs' selectedindex changes I call my event like
> this
> RaiseEvent Customer("MyCustomerName")

But you could do a class Customer() method call here as well. What's the difference?

>
> Next, on the form where the usercontrol is placed I can select the
> usercontrol in the code editor (left combo) and select it's event
> Customer
> (right combo) and I get something like this and can set my form.text to > the
> CustomerName
>
> Private Sub UserControl1_Customer(ByVal CustomerName As String) Handles > UserControl1.Customer
> me.Text = CustomerName
> end sub
>
> hth Peter
>
>
>
>
> "Brett" <no@spam.com> schreef in bericht
> news:#a**************@TK2MSFTNGP09.phx.gbl...
>>
>> "rawCoder" <ra******@hotmail.com> wrote in message
>> news:%2***************@TK2MSFTNGP14.phx.gbl...
>> > The way I use them ususally.
>> >
>> > Events are for intimation.
>> >
>> > An Object intimating a class for some event.
>> >
>> > You cant by regular means call a method of the class that has
> instantiated
>> > the object from within the object.
>>
>> Can you show a code example of what you mean here?
>>
>> > Events help in this case and make life easy.
>> >
>> > HTH
>> > rawCoder
>> >
>> > "Brett" <no@spam.com> wrote in message
>> > news:us**************@TK2MSFTNGP09.phx.gbl...
>> >> What are reasons to create your own events? Why not just call a
>> >> class
>> >> method/function instead?
>> >>
>> >> Thanks,
>> >> Brett
>> >>
>> >>
>> >
>> >
>>
>>
>
>


Nov 21 '05 #17
Brett,

Because you have it in your business rules and have it in the class for
that, although you can as well thrown an exception for that.

Cor
Nov 21 '05 #18
I'm understanding it better. Staying with the socket example, which event
is your handler listening for?

Can you possibly post some psuedo code?

Thanks,
Brett

"rawCoder" <ra******@hotmail.com> wrote in message
news:uH*************@TK2MSFTNGP14.phx.gbl...
Hi Brett,

I have a class that handles all the Socket related stuff and receives
data.
Now when some data is received it RAISES an EVENT so that the parent class
knows there was some data received.
So the parent class can like declare the object WithEvents and hence the
class implementing Socket operations doesnt need to know how to process
the
data or the business logic while the parent class handles it.

Suppose you have a custom message queue with thread synchronisation.
Now if the queue has an event that gets raised at appropraite time when
some
thing is added in it,
Then the caller doesnt need to do all the plumbing related to DeQueuing.
All it needs to do is declare the queue object and handle the data added
event.

One more way events are very very useful is for inter modular
communication
as specified by someone else already in the thread.
Suppose you have a class 'E' which has one event declared in it and one
public method that raises the event.
Now class A has an instance of class E and calls the public mehtod which
raises the event.
Another Class B which also has the instance and handles the event, gets
the
notification and the data associated.
The beauty is that the class 'E' never knew anything about 'A' or 'B'

Hope this makes sense to you more in terms of possible implementations
where
custom events can be used.
I have implemented one way or another these scenarios in more or else the
same way.
So custom events are really very helpful.

Let us know what exaclty is your confusion now ?

HTH
rawCoder

"Brett" <no@spam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I understand the form events because of user action but even with all of

the
post to my thread, I still have a difficult time seeing where I would use

a
custom event.

Perhaps relating it to something I'm working on will help. I use a while
loop with tcpclient and check if
networkStream = tcpClient.GetStream()
has anything. Can I create an event instead and put the while loop code

in
it?

Thanks,
Brett

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
> You are correct..you can write an application with a big while or do loop > and
> get input from the user then branch to different subs, funcitons, methods, > etc. That's what the original basic programming language did.
> However,
> events will make your programming life much easier and more flexible if
> you
> take the time to learn how to use them.
>
> "Brett" wrote:
>
>>
>> "Peter Proost" <pp*****@nospam.hotmail.com> wrote in message
>> news:%2******************@tk2msftngp13.phx.gbl...
>> > Hi, I use them in usercontrols for example I've got a usercontrol with >> > a
>> > combobox on it and some more controls.
>> > The combobox is filled with customers, and when I choose one the other >> > controls on the usercontrol get filled but I also want to notify the
>> > form
>> > where my usercontrol is on. So in my usercontrol I code:
>> >
>> > Public Event Customer(ByVal CustomerName as String)
>> >
>> > and then when the comboxs' selectedindex changes I call my event
>> > like
>> > this
>> > RaiseEvent Customer("MyCustomerName")
>>
>> But you could do a class Customer() method call here as well. What's the >> difference?
>>
>> >
>> > Next, on the form where the usercontrol is placed I can select the
>> > usercontrol in the code editor (left combo) and select it's event
>> > Customer
>> > (right combo) and I get something like this and can set my form.text to >> > the
>> > CustomerName
>> >
>> > Private Sub UserControl1_Customer(ByVal CustomerName As String) Handles >> > UserControl1.Customer
>> > me.Text = CustomerName
>> > end sub
>> >
>> > hth Peter
>> >
>> >
>> >
>> >
>> > "Brett" <no@spam.com> schreef in bericht
>> > news:#a**************@TK2MSFTNGP09.phx.gbl...
>> >>
>> >> "rawCoder" <ra******@hotmail.com> wrote in message
>> >> news:%2***************@TK2MSFTNGP14.phx.gbl...
>> >> > The way I use them ususally.
>> >> >
>> >> > Events are for intimation.
>> >> >
>> >> > An Object intimating a class for some event.
>> >> >
>> >> > You cant by regular means call a method of the class that has
>> > instantiated
>> >> > the object from within the object.
>> >>
>> >> Can you show a code example of what you mean here?
>> >>
>> >> > Events help in this case and make life easy.
>> >> >
>> >> > HTH
>> >> > rawCoder
>> >> >
>> >> > "Brett" <no@spam.com> wrote in message
>> >> > news:us**************@TK2MSFTNGP09.phx.gbl...
>> >> >> What are reasons to create your own events? Why not just call a
>> >> >> class
>> >> >> method/function instead?
>> >> >>
>> >> >> Thanks,
>> >> >> Brett
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>>
>>



Nov 21 '05 #19

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sasha | last post by:
Hi everyone, Here is my problem: I have the following classes: - DataNode - this class is designed to hold some data and will be contained in a tree like data structure DataTree. When...
6
by: Saso Zagoranski | last post by:
Hi! How can I unregister all the events registered to a control? I have seen a piece of code in another thread, which gets all the registered handlers for a specific event. Let's say I have a...
14
by: JPRoot | last post by:
Hi I use the following syntax to have events inherited from base to child classes which works nicely (virtual and override keyword on events). But I am wondering if it is a "supported" way of using...
2
by: Bob Rundle | last post by:
I have the following code, which appears to be working. However it doesn't look right. The part I am wondering about is the logic in DisconnectEvents(). This logic creates a new delegate and...
4
by: LP | last post by:
Hello! I am still transitioning from VB.NET to C#. I undertand the basic concepts of Delegates, more so of Events and somewhat understand AsyncCallback methods. But I need some clarification on...
11
by: Nicky Smith | last post by:
Hello, I'm studying a book on VB.net Win apps, and I'm reading a section on events and delegates and raising events. Is it just me, or is this not just subs dressed up as something else? I...
30
by: Burkhard | last post by:
Hi, I am new to C# (with long year experience in C++) and I am a bit confused by the language construct of events. What is it I can do with events that I cannot do with delegates? At the moment...
5
by: Richard Maher | last post by:
Hi, Here I mean "User" in the Programmer or Javascript sense. I merely wish to programmatically trigger an Event. It would be absolutely fantastic if there was a (Form level?) ONUSEREVENT() and...
14
by: xoozlez | last post by:
Hi there, I have a registration form where I like to filter out the past events of 2007. This is the code I am using : strSQL = "SELECT EventID, EventName, EventDateBegin, EventDateEnd,...
1
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.