Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2007

Tip: Looking for answers? Try searching our database.

AddHandler problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Barry - 13 May 2007 12:59 GMT
Hi

when creating a handler

AddHandler btn.Click, AddressOf btnAddProjectNotes

for the following delegate

Protected Sub btnAddProjectNotes_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnAddProjectNotes.Click

End Sub

if get this error messsage

Private Dim WithEvents btnAddProjectNotes As
System.Web.UI.WebControls.Button' does not have the same signature as
delegate 'Delegate Sub EventHandler(sender As Object, e As
System.EventArgs)'

how do i correct this problem

TIA
Barry
Alvin Bruney [MVP] - 13 May 2007 13:37 GMT
I don't know VB that well but i think it is complaining about the protected
type.

Signature

Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley

> Hi
>
[quoted text clipped - 20 lines]
> TIA
> Barry
Rory Becker - 13 May 2007 15:03 GMT
> AddHandler btn.Click, AddressOf btnAddProjectNotes
>
[quoted text clipped - 5 lines]
>
> how do i correct this problem

You are trying to attach to the object rather than the method.

You should write...
-------------------------------------------------------------
AddHandler btn.Click, AddressOf btnAddProjectNotes_Click
-------------------------------------------------------------
...rather than...
-------------------------------------------------------------
AddHandler btn.Click, AddressOf btnAddProjectNotes
-------------------------------------------------------------

HTH

--
Rory
Barry - 13 May 2007 15:20 GMT
Thanks for the reply, i did find out the error soon after i posted the
problem.

for more on the subject read my next post

>> AddHandler btn.Click, AddressOf btnAddProjectNotes
>>
[quoted text clipped - 21 lines]
> --
> Rory

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.