Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 9, 2025

The Visual Basic documentation for "How to call an event handler" was confusing because it didn't clearly distinguish between the two sides of events:

  1. Event publishing - declaring events and raising them with RaiseEvent (which actually calls/invokes the event handlers)
  2. Event subscription - subscribing to events with Handles/WithEvents or AddHandler (which sets up handlers to be called later)

Changes Made

Updated main article (how-to-call-an-event-handler.md):

  • Changed title from "How to call an event handler" → "How to subscribe to events and handle them"
  • Updated subheadings from "Call an event handler using..." → "Subscribe to an event using..."
  • Added clear explanation distinguishing event publishing vs. subscription
  • Clarified that RaiseEvent is what actually "calls" the event handlers
  • Preserved all existing code examples (they demonstrate both concepts well)

Updated cross-references in 4 additional files to reflect the new title:

  • Error documentation (bc33003.md)
  • Related procedure documentation
  • Table of contents

Problem Addressed

The original terminology was misleading:

  • Title suggested you directly invoke event handlers
  • Subheadings mentioned "calling" event handlers when describing subscription mechanisms
  • Missing distinction between RaiseEvent (calls handlers) vs AddHandler/Handles (subscribe to events)

The documentation now clearly explains that subscribing to events is different from raising them, resolving the conceptual confusion identified in the issue.

Fixes #28033.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


Internal previews

📄 File 🔗 Preview link
docs/visual-basic/misc/bc33003.md 'Handles' is not valid on operator declaration
docs/visual-basic/programming-guide/language-features/procedures/how-to-call-a-procedure-that-does-not-return-a-value.md How to: Call a Procedure that Does Not Return a Value (Visual Basic)
docs/visual-basic/programming-guide/language-features/procedures/how-to-call-an-event-handler.md How to subscribe to events and handle them
docs/visual-basic/programming-guide/language-features/procedures/sub-procedures.md Sub procedures (Visual Basic)
docs/visual-basic/programming-guide/language-features/procedures/toc.yml docs/visual-basic/programming-guide/language-features/procedures/toc

@dotnet-policy-service dotnet-policy-service bot added the okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. label Sep 9, 2025
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Clearly distinguish between "subscribing to an existing event with an event handler" and "raising an event" Fix event handler documentation terminology to distinguish between event publishing and subscription Sep 9, 2025
@Copilot Copilot AI requested a review from BillWagner September 9, 2025 18:56
Copilot finished work on behalf of BillWagner September 9, 2025 18:56
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ready for final review after accepting suggestions.

@BillWagner BillWagner requested a review from gewarren September 10, 2025 14:19
@BillWagner BillWagner marked this pull request as ready for review September 10, 2025 14:19
@BillWagner BillWagner requested a review from a team as a code owner September 10, 2025 14:19
@BillWagner BillWagner enabled auto-merge (squash) September 11, 2025 14:18
@BillWagner BillWagner closed this Sep 11, 2025
auto-merge was automatically disabled September 11, 2025 15:17

Pull request was closed

@BillWagner BillWagner reopened this Sep 11, 2025
@BillWagner BillWagner merged commit 7a45966 into main Sep 11, 2025
16 of 17 checks passed
@BillWagner BillWagner deleted the copilot/fix-28033 branch September 11, 2025 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet-visualbasic/svc errors-warnings/subsvc okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clearly distinguish between "subscribing to an existing event with an event handler" and "raising an event"
3 participants