Results 1 to 5 of 5

Thread: Is it possible to rename hidden selection in vb.net?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2010
    Posts
    131

    Question Is it possible to rename hidden selection in vb.net?

    There's some code I have hidden via the Outline-Hide selection method, and the hidden code shows as a box with 3 dots. I saw that if you put some code in the #region - #end region area the hidden code box can be renamed, but region-end region cannot be used inside a property, so is there any other method to rename the hidden code in a property?

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: Is it possible to rename hidden selection in vb.net?

    I know of no way to do that. It's an interesting idea. I assume you want to be able to expand and compress different chunks of code to assist in organization. I've thought it would be convenient, as well, though only in the longest of methods.
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2010
    Posts
    131

    Re: Is it possible to rename hidden selection in vb.net?

    yeah, here's what I've currently got but I am not understanding it, sounds like html code to me:

    #Region " Property Variables "
    ''' <summary>
    ''' Property variable for the Font the user wishes to use
    ''' </summary>
    ''' <remarks></remarks>
    Private _font As Font

    ''' <summary>
    ''' Property variable for the text to be printed
    ''' </summary>
    ''' <remarks></remarks>
    Private _text As String
    #End Region

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Is it possible to rename hidden selection in vb.net?

    I'm not even sure I understood anything in this thread.... what is the problem exactly?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: Is it possible to rename hidden selection in vb.net?

    The Region stuff is just a useful way to group blocks of code into collapsible sections (or regions). You cannot group a block of code inside a method or property. I don't know why this is, I don't see any real reason why this couldn't be possible except it being more work for the developers of the IDE perhaps.

    Anyway, if your methods are so large that you want to use a region block inside them, then you should really consider refactoring: break those large methods up into smaller methods, and you probably won't even need the region blocks as the code will be grouped into smaller methods anyway.


    As for the 'html code' you've shown us, that is quite unrelated to the region blocks. They are called XML Comments and are used to generate the Intellisense. For example, if I were to type "_font" in your code somewhere, Intellisense would pop up with the description: "Property variable for the Font the user wishes to use".
    Furthermore, there are tools available (SandCastle, NDoc, etc) that can use these XML comments to automatically generate a help file or documentation in the style of MSDN. Very useful indeed.

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