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 Studio
  4. collapse specific outlining section

collapse specific outlining section

Scheduled Pinned Locked Moved Visual Studio
csharpvisual-studioquestion
2 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.
  • M Offline
    M Offline
    m schmidt
    wrote on last edited by
    #1

    Hi, does anybody know if it is possible to collapse a specific section? I declared with following lines, some comments of our source code: #pragma region history /* comments ... */ #pragma endregion I found a solution, which collapses all code sections to it's definitions, which is nested in the Visual Studio Macros: Private blnLoading As Boolean Private Sub DocumentEvents_DocumentOpened(ByVal Document As EnvDTE.Document) Handles DocumentEvents.DocumentOpened blnLoading = True End Sub Private Sub WindowEvents_WindowActivated(ByVal GotFocus As EnvDTE.Window, ByVal LostFocus As EnvDTE.Window) Handles WindowEvents.WindowActivated If blnLoading Then DTE.ExecuteCommand("Edit.CollapsetoDefinitions") blnLoading = False End If End Sub But it collapse just all sections? Have anybody a solution for collapsing my specific section?

    R 1 Reply Last reply
    0
    • M m schmidt

      Hi, does anybody know if it is possible to collapse a specific section? I declared with following lines, some comments of our source code: #pragma region history /* comments ... */ #pragma endregion I found a solution, which collapses all code sections to it's definitions, which is nested in the Visual Studio Macros: Private blnLoading As Boolean Private Sub DocumentEvents_DocumentOpened(ByVal Document As EnvDTE.Document) Handles DocumentEvents.DocumentOpened blnLoading = True End Sub Private Sub WindowEvents_WindowActivated(ByVal GotFocus As EnvDTE.Window, ByVal LostFocus As EnvDTE.Window) Handles WindowEvents.WindowActivated If blnLoading Then DTE.ExecuteCommand("Edit.CollapsetoDefinitions") blnLoading = False End If End Sub But it collapse just all sections? Have anybody a solution for collapsing my specific section?

      R Offline
      R Offline
      redjoy
      wrote on last edited by
      #2

      try this: #region 'Some text comment explaining the enclosed code, i.e., Helper methods ...put code to collapse here... #endregion

      Michael ᅠᅠᅠᅠᅠᅠᅠᅠᅠ\|/ ᅠᅠᅠᅠᅠᅠᅠ^O^O^ ——o00o—0—o00o—— If we knew what it was we were doing, it would not be called research, would it? --Albert Einstein

      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