Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. <b>Tranlation of New Event<b>

<b>Tranlation of New Event<b>

Scheduled Pinned Locked Moved Visual Basic
csharpquestiontutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eatwork
    wrote on last edited by
    #1

    Hi everybody, I have a question regarding new events in VS2003. I have read that it is not possible in 2003 but is available in 2005. I have found some code I wish to translate from C# but can't seem to figure it out. Does anyone know how to do this: public new event DateCancelEventHandler Validating { add{this.validating+=value;} remove { try { this.validating-=value; } catch(Exception ex) { throw new ArgumentException(ex.Message ,"Validating"); } } } in vb.net? thank you eatwork -- modified at 18:17 Thursday 4th May, 2006

    D 1 Reply Last reply
    0
    • E eatwork

      Hi everybody, I have a question regarding new events in VS2003. I have read that it is not possible in 2003 but is available in 2005. I have found some code I wish to translate from C# but can't seem to figure it out. Does anyone know how to do this: public new event DateCancelEventHandler Validating { add{this.validating+=value;} remove { try { this.validating-=value; } catch(Exception ex) { throw new ArgumentException(ex.Message ,"Validating"); } } } in vb.net? thank you eatwork -- modified at 18:17 Thursday 4th May, 2006

      D Offline
      D Offline
      Dave Doknjas
      wrote on last edited by
      #2

      Our Instant VB C# to VB converter produces: Public Shadows Custom Event Validating As DateCancelEventHandler AddHandler(ByVal value As DateCancelEventHandler) AddHandler Me.validating, value End AddHandler RemoveHandler(ByVal value As DateCancelEventHandler) Try RemoveHandler Me.validating, value Catch ex As Exception Throw New ArgumentException(ex.Message,"Validating") End Try End RemoveHandler RaiseEvent(ByVal sender As Object, ByVal e As EventArgs) End RaiseEvent End Event David Anton www.tangiblesoftwaresolutions.com Instant C#: VB to C# converter Instant VB: C# to VB converter Instant C++: C# to C++ converter and VB to C++ converter Instant J#: VB to J# converter Clear VB: Cleans up VB.NET code Clear C#: Cleans up C# code

      E 1 Reply Last reply
      0
      • D Dave Doknjas

        Our Instant VB C# to VB converter produces: Public Shadows Custom Event Validating As DateCancelEventHandler AddHandler(ByVal value As DateCancelEventHandler) AddHandler Me.validating, value End AddHandler RemoveHandler(ByVal value As DateCancelEventHandler) Try RemoveHandler Me.validating, value Catch ex As Exception Throw New ArgumentException(ex.Message,"Validating") End Try End RemoveHandler RaiseEvent(ByVal sender As Object, ByVal e As EventArgs) End RaiseEvent End Event David Anton www.tangiblesoftwaresolutions.com Instant C#: VB to C# converter Instant VB: C# to VB converter Instant C++: C# to C++ converter and VB to C++ converter Instant J#: VB to J# converter Clear VB: Cleans up VB.NET code Clear C#: Cleans up C# code

        E Offline
        E Offline
        eatwork
        wrote on last edited by
        #3

        Hello David, Thank you for your response. I have tried the code you supplied, but it does not seem to work in VS2003. It says that an end of statement is expected on the line "Event Validating As DateCancelEventHandler" and everything else after that generates some code errors. Do you know if it is possible to create custom events in VB.net, similar to those in C#? Thanks eatwork

        D 1 Reply Last reply
        0
        • E eatwork

          Hello David, Thank you for your response. I have tried the code you supplied, but it does not seem to work in VS2003. It says that an end of statement is expected on the line "Event Validating As DateCancelEventHandler" and everything else after that generates some code errors. Do you know if it is possible to create custom events in VB.net, similar to those in C#? Thanks eatwork

          D Offline
          D Offline
          Dave Doknjas
          wrote on last edited by
          #4

          Custom events are not available in VB 2003. David Anton www.tangiblesoftwaresolutions.com Instant C#: VB to C# converter Instant VB: C# to VB converter Instant C++: C# to C++ converter and VB to C++ converter Instant J#: VB to J# converter Clear VB: Cleans up VB.NET code Clear C#: Cleans up C# code

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups