Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 210967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:03:11+00:00 2026-05-11T18:03:11+00:00

I think know how to do this in C# but I’m having syntax trouble

  • 0

I think know how to do this in C# but I’m having syntax trouble in VB.NET because I need to take advantage of the ‘handles’ event stuff.

I have different events that I somehow (probably delegate) need stored in a property of an attribute (I just add an attribute to a property linking to the corresponding event).

E.g.

<BindEvent(EventThing)>_
Public ReadOnly Property IsTrue() As Boolean
  Get
    Return True
  End Get
End Property

They need to be events so that other programmers can use the VB.NET handles keyword on methods.

Public Delegate Sub TestEvent(ByVal sender As Object, ByVal e As Object)
Public Event E As TestEvent

Public Sub Test() Handles E
End Sub

These properties are already raising a general event, which I am catching, determining the related property and thus getting the related attribute (and delegate/event). I want to then raise the event that’s related.

If I just use a delegate tied to the particular event that won’t raise other handlers will it?

I also want to avoid having to write a sub for each property that just uses Raise Event on the event type if possible as this seems redundant.

e.g. avoid:

Public Event E As TestEvent
Public Sub CallE(ByVal sender As Object, ByVal e As Object)
  RaiseEvent E(sender, e)
End Sub
<BindDelegate(DelegateToCallE)>_
Public ReadOnly Property IsTrue() As Boolean
  Get
    Return True
  End Get
End Property
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:03:11+00:00Added an answer on May 11, 2026 at 6:03 pm
    Public Class foo
    
        Public Event TestEvent()
    
    End Class
    
    
    Public Class bar
        Dim WithEvents x As New foo
        Public Sub HandleEvent() Handles x.TestEvent
        End Sub
    End Class
    

    Is this what you are looking for?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think I know the answer to this but I have the need to
I think I know how to handle this case, but I just want to
I think I should know this, but my mind has gone blank. I'm making
I think I may know the answer to this question but I'm actually looking
I know there are plenty of resources on this but I'm having a tough
I know there is no such thing as a dumb question but this is:
I know this is a pretty basic question, and I think I know the
I think most people know how to do this via the GUI (right click
I think I know how to create custom encrypted RSA keys, but how can
I think I know the answer, but I would like to bounce around some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.