473,706 Members | 2,336 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RaiseEvent... vs Calling Sub directly?

Ron
Greetings,

I am trying to understand the rational for Raising Events
instead of just calling a sub. Could someone explain the
difference between the following 2 scenarios? Why would I
want to raise an event instead of just calling the sub?

Scenario1 -- Using Events
------------------------------------------------------
Public Class Form1

Private WithEvents c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub()
End Sub

Sub cTest(ByVal Msg As String) Handles c1.TestEvent
MsgBox Msg
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Event TestEvent(ByVal Msg As String)

Public Sub TestSub
Dim strTemp As String = "testing"
RaiseEvent TestEvent(strTe mp)
End Sub
End Class

*************** *************** *************** ********
*************** *************** *************** ********

Scenario2 -- No Events
-----------------------------------------------------
Public Class Form1
Dim c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Sub TestSub
Test2Sub()
End Sub

Private Sub Test2Sub()
MsgBox "Testing"
End Sub
End Class
---------------------------------------------------

Thanks,
Ron
Nov 21 '05 #1
12 7083

Jan. 6, 2005

By using events, more than one method or component can handle the
same event....

Public Class Form1

Private WithEvents c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub()
End Sub

Sub cTest(ByVal Msg As String) Handles c1.TestEvent
MsgBox Msg
End Sub

Sub SECONDTEST(byva l msg as string) handles c1.testevent
Do some more work here........
end sub
End Class

So if more than one person had the instance of c1 then all of them (on
seperate computers such as .Net Remoting) could display the message on their
computers. It is sort of like a newsletter where multiple people sign up for
the same event (publishing a new edition). So in conclusion, if other
components are using your class that might want to also handle the event,
then you should use events. If this reply helped you, then please click on
the "Yes" box above this message! I hope this
helps to clear up some of the details!
Joseph MCAD
"Ron" wrote:
Greetings,

I am trying to understand the rational for Raising Events
instead of just calling a sub. Could someone explain the
difference between the following 2 scenarios? Why would I
want to raise an event instead of just calling the sub?

Scenario1 -- Using Events
------------------------------------------------------
Public Class Form1

Private WithEvents c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub()
End Sub

Sub cTest(ByVal Msg As String) Handles c1.TestEvent
MsgBox Msg
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Event TestEvent(ByVal Msg As String)

Public Sub TestSub
Dim strTemp As String = "testing"
RaiseEvent TestEvent(strTe mp)
End Sub
End Class

*************** *************** *************** ********
*************** *************** *************** ********

Scenario2 -- No Events
-----------------------------------------------------
Public Class Form1
Dim c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Sub TestSub
Test2Sub()
End Sub

Private Sub Test2Sub()
MsgBox "Testing"
End Sub
End Class
---------------------------------------------------

Thanks,
Ron

Nov 21 '05 #2
Ron
Hi Joseph,

Thanks for your explanation. Yes, it did clear things up
for me. But I don't see a "Yes" box above the message for
me to click on.

Question: Your explanation sounds similar to using
Delegates. May I ask if there is a similarity here? If
yes, what would be the subtle difference between using
Events or Delegates?

Thanks for your help,
Ron

-----Original Message-----

Jan. 6, 2005

By using events, more than one method or component can handle thesame event....

Public Class Form1

Private WithEvents c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub()
End Sub

Sub cTest(ByVal Msg As String) Handles c1.TestEvent
MsgBox Msg
End Sub

Sub SECONDTEST(byva l msg as string) handles c1.testevent
Do some more work here........
end sub
End Class

So if more than one person had the instance of c1 then all of them (onseperate computers such as .Net Remoting) could display the message on theircomputers. It is sort of like a newsletter where multiple people sign up forthe same event (publishing a new edition). So in conclusion, if othercomponents are using your class that might want to also handle the event,then you should use events. If this reply helped you, then please click onthe "Yes" box above this message! I hope this
helps to clear up some of the details!

Joseph MCAD
"Ron" wrote:
Greetings,

I am trying to understand the rational for Raising Events instead of just calling a sub. Could someone explain the difference between the following 2 scenarios? Why would I want to raise an event instead of just calling the sub?

Scenario1 -- Using Events
------------------------------------------------------
Public Class Form1

Private WithEvents c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub()
End Sub

Sub cTest(ByVal Msg As String) Handles c1.TestEvent
MsgBox Msg
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Event TestEvent(ByVal Msg As String)

Public Sub TestSub
Dim strTemp As String = "testing"
RaiseEvent TestEvent(strTe mp)
End Sub
End Class

*************** *************** *************** ********
*************** *************** *************** ********

Scenario2 -- No Events
-----------------------------------------------------
Public Class Form1
Dim c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Sub TestSub
Test2Sub()
End Sub

Private Sub Test2Sub()
MsgBox "Testing"
End Sub
End Class
---------------------------------------------------

Thanks,
Ron

.

Nov 21 '05 #3
The other issue is knowing which sub to call. Let's say you are a button and
you need to mimic raisin the click event so someone knows you were just
clicked. How would you do this? You don't know what object you are on - a
form, a usercontrol? You don't know what method the developer wants to get
called to be notified that the button was clicked.

It would be impossible to implement a button click event by just calling
known methods.

"Ron" <an*******@disc ussions.microso ft.com> wrote in message
news:04******** *************** *****@phx.gbl.. .
Greetings,

I am trying to understand the rational for Raising Events
instead of just calling a sub. Could someone explain the
difference between the following 2 scenarios? Why would I
want to raise an event instead of just calling the sub?

Scenario1 -- Using Events
------------------------------------------------------
Public Class Form1

Private WithEvents c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub()
End Sub

Sub cTest(ByVal Msg As String) Handles c1.TestEvent
MsgBox Msg
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Event TestEvent(ByVal Msg As String)

Public Sub TestSub
Dim strTemp As String = "testing"
RaiseEvent TestEvent(strTe mp)
End Sub
End Class

*************** *************** *************** ********
*************** *************** *************** ********

Scenario2 -- No Events
-----------------------------------------------------
Public Class Form1
Dim c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Sub TestSub
Test2Sub()
End Sub

Private Sub Test2Sub()
MsgBox "Testing"
End Sub
End Class
---------------------------------------------------

Thanks,
Ron

Nov 21 '05 #4

Jan. 6, 2005

I don't understand what Marina means. The difference between events
and delegates is that with events you use AddHandler Obj.Event, AddressOf
Method while with delegates you can submit them across networks and the
internet. Then the component that you sent the delegate to can use
DelegateObj.Inv oke which will invoke a method on the component that the
delegate came from. This acts like a callback. This way the component across
the internet can call a method on a different component when it is done
processing something without having to have the instance of the other
component. In other words... The delegate can be thought of your email
address that you give the newsletter component. The newsletter can (across
the network or internet) then use the email address to send you (callback)
the newsletter when it publishes a new one (completes processing). If you
used events then the component across the internet would have to have an
object instance (access to your computer) of the component to callback. I
hope this is still understandable! The "Yes" button should be just above the
top of the message right under the information that shows the subject, from,
and in contents. Please look again for it! Thanks and have a great day! (Feel
free to ask more!)
Joseph MCAD

"Ron" wrote:
Hi Joseph,

Thanks for your explanation. Yes, it did clear things up
for me. But I don't see a "Yes" box above the message for
me to click on.

Question: Your explanation sounds similar to using
Delegates. May I ask if there is a similarity here? If
yes, what would be the subtle difference between using
Events or Delegates?

Thanks for your help,
Ron

-----Original Message-----

Jan. 6, 2005

By using events, more than one method or

component can handle the
same event....

Public Class Form1

Private WithEvents c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub()
End Sub

Sub cTest(ByVal Msg As String) Handles c1.TestEvent
MsgBox Msg
End Sub

Sub SECONDTEST(byva l msg as string) handles c1.testevent
Do some more work here........
end sub
End Class

So if more than one person had the instance of c1 then

all of them (on
seperate computers such as .Net Remoting) could display

the message on their
computers. It is sort of like a newsletter where multiple

people sign up for
the same event (publishing a new edition). So in

conclusion, if other
components are using your class that might want to also

handle the event,
then you should use events. If this reply helped you,

then please click on
the "Yes" box above this message! I hope this
helps to clear up some of the details!

Joseph MCAD
"Ron" wrote:
Greetings,

I am trying to understand the rational for Raising Events instead of just calling a sub. Could someone explain the difference between the following 2 scenarios? Why would I want to raise an event instead of just calling the sub?

Scenario1 -- Using Events
------------------------------------------------------
Public Class Form1

Private WithEvents c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub()
End Sub

Sub cTest(ByVal Msg As String) Handles c1.TestEvent
MsgBox Msg
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Event TestEvent(ByVal Msg As String)

Public Sub TestSub
Dim strTemp As String = "testing"
RaiseEvent TestEvent(strTe mp)
End Sub
End Class

*************** *************** *************** ********
*************** *************** *************** ********

Scenario2 -- No Events
-----------------------------------------------------
Public Class Form1
Dim c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Sub TestSub
Test2Sub()
End Sub

Private Sub Test2Sub()
MsgBox "Testing"
End Sub
End Class
---------------------------------------------------

Thanks,
Ron

.

Nov 21 '05 #5
I was saying, that unless you using events/delegates, there is no way to
register callbacks. The example in the post showed calling a specific
method in a specific class as a way of saying 'an event occurred'. Well, if
you are developing a button, you can't do that. What method would you call
to notify the user the someone just clicked the button? You can't - you need
to give the client a way to register for a callback.

I was giving another important example of why you would want events, vs.
calling a sub directly.

"Joseph MCAD" <Jo********@dis cussions.micros oft.com> wrote in message
news:F9******** *************** ***********@mic rosoft.com...

Jan. 6, 2005

I don't understand what Marina means. The difference between events
and delegates is that with events you use AddHandler Obj.Event, AddressOf
Method while with delegates you can submit them across networks and the
internet. Then the component that you sent the delegate to can use
DelegateObj.Inv oke which will invoke a method on the component that the
delegate came from. This acts like a callback. This way the component across the internet can call a method on a different component when it is done
processing something without having to have the instance of the other
component. In other words... The delegate can be thought of your email
address that you give the newsletter component. The newsletter can (across
the network or internet) then use the email address to send you (callback)
the newsletter when it publishes a new one (completes processing). If you
used events then the component across the internet would have to have an
object instance (access to your computer) of the component to callback. I
hope this is still understandable! The "Yes" button should be just above the top of the message right under the information that shows the subject, from, and in contents. Please look again for it! Thanks and have a great day! (Feel free to ask more!)
Joseph MCAD

"Ron" wrote:
Hi Joseph,

Thanks for your explanation. Yes, it did clear things up
for me. But I don't see a "Yes" box above the message for
me to click on.

Question: Your explanation sounds similar to using
Delegates. May I ask if there is a similarity here? If
yes, what would be the subtle difference between using
Events or Delegates?

Thanks for your help,
Ron

-----Original Message-----

Jan. 6, 2005

By using events, more than one method or

component can handle the
same event....

Public Class Form1

Private WithEvents c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub()
End Sub

Sub cTest(ByVal Msg As String) Handles c1.TestEvent
MsgBox Msg
End Sub

Sub SECONDTEST(byva l msg as string) handles c1.testevent
Do some more work here........
end sub
End Class

So if more than one person had the instance of c1 then

all of them (on
seperate computers such as .Net Remoting) could display

the message on their
computers. It is sort of like a newsletter where multiple

people sign up for
the same event (publishing a new edition). So in

conclusion, if other
components are using your class that might want to also

handle the event,
then you should use events. If this reply helped you,

then please click on
the "Yes" box above this message! I hope this
helps to clear up some of the details!

Joseph MCAD
"Ron" wrote:

> Greetings,
>
> I am trying to understand the rational for Raising

Events
> instead of just calling a sub. Could someone explain

the
> difference between the following 2 scenarios? Why

would I
> want to raise an event instead of just calling the sub?
>
> Scenario1 -- Using Events
> ------------------------------------------------------
> Public Class Form1
>
> Private WithEvents c1 As clsTest
>
> Sub Testing()
> c1 = New clsTest()
> c1.TestSub()
> End Sub
>
> Sub cTest(ByVal Msg As String) Handles c1.TestEvent
> MsgBox Msg
> End Sub
> End Class
> -----------------------------------------------------
> Public Class clsTest
> Public Event TestEvent(ByVal Msg As String)
>
> Public Sub TestSub
> Dim strTemp As String = "testing"
> RaiseEvent TestEvent(strTe mp)
> End Sub
> End Class
>
> *************** *************** *************** ********
> *************** *************** *************** ********
>
> Scenario2 -- No Events
> -----------------------------------------------------
> Public Class Form1
> Dim c1 As clsTest
>
> Sub Testing()
> c1 = New clsTest()
> c1.TestSub
> End Sub
> End Class
> -----------------------------------------------------
> Public Class clsTest
> Public Sub TestSub
> Test2Sub()
> End Sub
>
> Private Sub Test2Sub()
> MsgBox "Testing"
> End Sub
> End Class
> ---------------------------------------------------
>
> Thanks,
> Ron
>
.

Nov 21 '05 #6

Jan. 6, 2005

Yes, you are right if you are developing controls that respond to
user generated events. I was saying things in the context of implementing
events for your own code in the same application or in a different
applications that use it directly in code, but not exposing it to the UI.
There is a difference between using the component in code and on the UI. I
believe this is where we had a misunderstandin g of the context of what each
other was talking in terms of. I hope that I now have correctly interpreted
what you mean. Thanks and have a great day!
Joseph MCAD

"Joseph MCAD" wrote:

Jan. 6, 2005

By using events, more than one method or component can handle the
same event....

Public Class Form1

Private WithEvents c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub()
End Sub

Sub cTest(ByVal Msg As String) Handles c1.TestEvent
MsgBox Msg
End Sub

Sub SECONDTEST(byva l msg as string) handles c1.testevent
Do some more work here........
end sub
End Class

So if more than one person had the instance of c1 then all of them (on
seperate computers such as .Net Remoting) could display the message on their
computers. It is sort of like a newsletter where multiple people sign up for
the same event (publishing a new edition). So in conclusion, if other
components are using your class that might want to also handle the event,
then you should use events. If this reply helped you, then please click on
the "Yes" box above this message! I hope this
helps to clear up some of the details!
Joseph MCAD
"Ron" wrote:
Greetings,

I am trying to understand the rational for Raising Events
instead of just calling a sub. Could someone explain the
difference between the following 2 scenarios? Why would I
want to raise an event instead of just calling the sub?

Scenario1 -- Using Events
------------------------------------------------------
Public Class Form1

Private WithEvents c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub()
End Sub

Sub cTest(ByVal Msg As String) Handles c1.TestEvent
MsgBox Msg
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Event TestEvent(ByVal Msg As String)

Public Sub TestSub
Dim strTemp As String = "testing"
RaiseEvent TestEvent(strTe mp)
End Sub
End Class

*************** *************** *************** ********
*************** *************** *************** ********

Scenario2 -- No Events
-----------------------------------------------------
Public Class Form1
Dim c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Sub TestSub
Test2Sub()
End Sub

Private Sub Test2Sub()
MsgBox "Testing"
End Sub
End Class
---------------------------------------------------

Thanks,
Ron

Nov 21 '05 #7
I don't think I really understand you. In any case where the component is a
library component - meaning it could be used in any project, it would have
to follow this model. Regardless of whether or not it had anything to do
with the UI. Example: a Timer component. Has nothing to do with UI, can be
created entirely in code, but needs to let the consumer know that the time
has elapsed. Events pretty much become necessary when you write a reusable
object that has behaviors that you need to extend.

I am not sure why you are debating this, as my post was just giving another
example of why one would want to use events. I did not contradict anything
you had said in your post.

"Joseph MCAD" <Jo********@dis cussions.micros oft.com> wrote in message
news:0E******** *************** ***********@mic rosoft.com...

Jan. 6, 2005

Yes, you are right if you are developing controls that respond to
user generated events. I was saying things in the context of implementing
events for your own code in the same application or in a different
applications that use it directly in code, but not exposing it to the UI.
There is a difference between using the component in code and on the UI. I
believe this is where we had a misunderstandin g of the context of what each other was talking in terms of. I hope that I now have correctly interpreted what you mean. Thanks and have a great day!
Joseph MCAD

"Joseph MCAD" wrote:

Jan. 6, 2005

By using events, more than one method or component can handle the same event....

Public Class Form1

Private WithEvents c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub()
End Sub

Sub cTest(ByVal Msg As String) Handles c1.TestEvent
MsgBox Msg
End Sub

Sub SECONDTEST(byva l msg as string) handles c1.testevent
Do some more work here........
end sub
End Class

So if more than one person had the instance of c1 then all of them (on seperate computers such as .Net Remoting) could display the message on their computers. It is sort of like a newsletter where multiple people sign up for the same event (publishing a new edition). So in conclusion, if other
components are using your class that might want to also handle the event, then you should use events. If this reply helped you, then please click on the "Yes" box above this message! I hope this
helps to clear up some of the details!
Joseph MCAD
"Ron" wrote:
Greetings,

I am trying to understand the rational for Raising Events
instead of just calling a sub. Could someone explain the
difference between the following 2 scenarios? Why would I
want to raise an event instead of just calling the sub?

Scenario1 -- Using Events
------------------------------------------------------
Public Class Form1

Private WithEvents c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub()
End Sub

Sub cTest(ByVal Msg As String) Handles c1.TestEvent
MsgBox Msg
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Event TestEvent(ByVal Msg As String)

Public Sub TestSub
Dim strTemp As String = "testing"
RaiseEvent TestEvent(strTe mp)
End Sub
End Class

*************** *************** *************** ********
*************** *************** *************** ********

Scenario2 -- No Events
-----------------------------------------------------
Public Class Form1
Dim c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Sub TestSub
Test2Sub()
End Sub

Private Sub Test2Sub()
MsgBox "Testing"
End Sub
End Class
---------------------------------------------------

Thanks,
Ron

Nov 21 '05 #8

Jan. 6, 2005

I just realized that if you double click a post then it will come up
in a whole new window. That means that the "Yes" button will be at the bottom
of the message. If you could click it on my first post I would greatly
appreciate it! Thanks and I hope that your question has been answered.

"Ron" wrote:
Hi Joseph,

Thanks for your explanation. Yes, it did clear things up
for me. But I don't see a "Yes" box above the message for
me to click on.

Question: Your explanation sounds similar to using
Delegates. May I ask if there is a similarity here? If
yes, what would be the subtle difference between using
Events or Delegates?

Thanks for your help,
Ron

-----Original Message-----

Jan. 6, 2005

By using events, more than one method or

component can handle the
same event....

Public Class Form1

Private WithEvents c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub()
End Sub

Sub cTest(ByVal Msg As String) Handles c1.TestEvent
MsgBox Msg
End Sub

Sub SECONDTEST(byva l msg as string) handles c1.testevent
Do some more work here........
end sub
End Class

So if more than one person had the instance of c1 then

all of them (on
seperate computers such as .Net Remoting) could display

the message on their
computers. It is sort of like a newsletter where multiple

people sign up for
the same event (publishing a new edition). So in

conclusion, if other
components are using your class that might want to also

handle the event,
then you should use events. If this reply helped you,

then please click on
the "Yes" box above this message! I hope this
helps to clear up some of the details!

Joseph MCAD
"Ron" wrote:
Greetings,

I am trying to understand the rational for Raising Events instead of just calling a sub. Could someone explain the difference between the following 2 scenarios? Why would I want to raise an event instead of just calling the sub?

Scenario1 -- Using Events
------------------------------------------------------
Public Class Form1

Private WithEvents c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub()
End Sub

Sub cTest(ByVal Msg As String) Handles c1.TestEvent
MsgBox Msg
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Event TestEvent(ByVal Msg As String)

Public Sub TestSub
Dim strTemp As String = "testing"
RaiseEvent TestEvent(strTe mp)
End Sub
End Class

*************** *************** *************** ********
*************** *************** *************** ********

Scenario2 -- No Events
-----------------------------------------------------
Public Class Form1
Dim c1 As clsTest

Sub Testing()
c1 = New clsTest()
c1.TestSub
End Sub
End Class
-----------------------------------------------------
Public Class clsTest
Public Sub TestSub
Test2Sub()
End Sub

Private Sub Test2Sub()
MsgBox "Testing"
End Sub
End Class
---------------------------------------------------

Thanks,
Ron

.

Nov 21 '05 #9
Ron wrote:
Greetings,

I am trying to understand the rational for Raising Events
instead of just calling a sub.

In general, events are useful when you have asynchronous or otherwise
unpredictable operations. For example, you might have a class that
monitors something (file system, database, etc.) and raises an event
when certain conditions are met.

Events are especially useful when you are programming hardware devices.
You can implement a class that controls various functions of a device,
and raises events when the functions are complete. Often the device
will have to be polled, but if you encapsulate that in the class the
user of the class only sees the XXX_Complete event. It's much cleaner.

Nov 21 '05 #10

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

Similar topics

1
1636
by: Guille | last post by:
Hi all! I'm having some weird behaviour in a .NET application i'm developing. I'll try to explain: I've created a Class that wraps an asynchronous socket. When connect callback is called, i raise a class event : ' Create socket sock = New Socket(AddressFamily.InterNetwork, _
6
54452
by: shachar | last post by:
hi all. in vb.net i can write RaiseEvent. can i do it in C# also? how? thanks - shachar.
2
1434
by: Lim | last post by:
I've developed a program that raise an event. This program works fine on a Windows 2000 Professional PC. However when I try to run the program on a Windos XP Professional PC, the program will not execute the raiseevent function. How can I resolve the problem?
3
3284
by: Adam | last post by:
I cannot figure out what I'm doing wrong, can someone shed some light on this for me? I have the following code inside a working user control (MyControl): Public Event SubmitClick(ByVal sender As Object, ByVal e As EventArgs) Private Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click RaiseEvent SubmitClick(sender, e)
2
2004
by: dmoonme | last post by:
I'm trying to rename some files in a directory. Pretty basic stuff - renaming the files works fine but the problem I have is updated the text in textbox. All I want to do is appendtext to a textbox. The problem is that duplicate text occurs. Hopefully my code will explain better what I'm trying to do and what i'm doing wrong :) Thanks for your help! Public Class Form1 Private Sub btnRun_Click(ByVal sender As System.Object, ByVal e...
1
2047
by: Terry Olsen | last post by:
I have a program with a couple of long running processes that i'm calling on a separate thread. When the process is completed, I want to raise an event to tell the main thread that it's done. I set it up this way... Public Class frmLongRunningProcess Public Enum Proc ParseZipFiles = 0
2
1379
by: ffa | last post by:
I have a number of classes that declare a public Event called RefreshData: Public Class Client Implements INotifyPropertyChanged Implements IDisposable Implements IDataErrorInfo Public Event PropertyChanged(ByVal sender As Object, ByVal e As
7
2686
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file name based on the name of the VB6 application. A second choice would be a file name based on the # COM interface assembly. I have tried calling Assembly.GetCallingAssembly() but this fails when I use the VB6 client. Is there a way to get this...
4
14836
by: anandamd | last post by:
Hi, I am a newbie to vb.net, I have converted C# code to vb.net using the online converter tools. I have got rid of all the error messages but there is one I can't seem to figure out. Any ideas or help is appreciated. Private Function MakeAnimation(ByVal As Double, ByVal duration As Double, ByVal endEvent As EventHandler) As DoubleAnimation Dim anim As New DoubleAnimation(, TimeSpan.FromMilliseconds(duration)) ...
0
8697
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9286
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9156
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9055
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8997
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7911
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5939
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2095
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.