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 596553
In Process

The Archive Base Latest Questions

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

This questions is for VBers, it’s irrelevant in C#. In VB, when you create

  • 0

This questions is for VBers, it’s irrelevant in C#.

In VB, when you create a module, all it’s functions and members are available in the scope without need to type the module name, just like all the VB functions (Rnd, Mid, IIf etc.).

I want to create a module but I should have to explicitly write it’s name to access it’s members, i.e. it shouldn’t be loaded to the scope like a namespace.

Update

For example, I have a Module of extension methods, I don’t want all it’s members to show up on the scope and in the intellisense.

I want it to be available only by instance.ExtensionMethod().

Any ideas?

  • 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-13T16:11:03+00:00Added an answer on May 13, 2026 at 4:11 pm

    If you create a Class instead of a Module then VB.NET will insist you use the class name. For example:

    Public MustInherit Class Utils
      Public Shared Function Sqr(ByVal arg As Double) As Double
        Return arg * arg
      End Function
    End Class
    ...
    Dim result As Double = Utils.Sqr(42) 'Utils required
    

    It is hardly necessary, but you can prevent anyone from inheriting this class by adding a private constructor.


    Update

    To avoid extension methods from polluting the global namespace in IntelliSense. I found a rather unexpected workaround for this:

    Imports System.Runtime.CompilerServices
    Imports System.ComponentModel
    
    <EditorBrowsable(EditorBrowsableState.Never)> _
    Module Extensions
      <Extension()> _
      Public Sub Method(ByVal obj As ExampleClass)
      End Sub
    End Module
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

[This questions pertains to Access 2003] I need to add an additional criteria (b)
First of all let me say that this questions is slightly connected to another
This is an example URL. http://stackoverflow.com/questions/ask?a=1&b=2 question : I need to fetch path name
I've seen this questions here . I'm wondering if there exists an official name
I know this questions has come up in various guises before, but this is
I'm a bit perplexed by drag and drop in wxPython (but perhaps this questions
Similar questions to this one have been asked but none seem to address my
I think questions like this are the reason why I don't like working with
I know questions of this kind have been asked before, but my situation differs
I've seen many questions about this, but i've never really got the answer that

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.