Results 1 to 4 of 4

Thread: [RESOLVED] get name of current module

  1. #1

    Thread Starter
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657

    Resolved [RESOLVED] get name of current module

    Hello,
    What I'd like to is get the name of the current Module running in a VB app. If I am in a Form, I can use "Me.Name", but in a Module that will not work. I tried:

    System.Reflection.Assembly.GetExecutingAssembly().GetModules()(0).Name

    But that gives the name of the app (like "WindowsApplication1.exe") rather than "Module1", which is what I'd be looking for.
    Last edited by BruceG; Jun 12th, 2010 at 09:39 AM. Reason: resolved
    "It's cold gin time again ..."

    Check out my website here.

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: get name of current module

    Can you try.
    Code:
    System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3

    Thread Starter
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657

    Re: get name of current module

    That was it. Thanks a lot!
    "It's cold gin time again ..."

    Check out my website here.

  4. #4
    Junior Member
    Join Date
    May 2017
    Posts
    27

    Re: [RESOLVED] get name of current module

    How about for the current executing form?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width