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 Basic
  4. Partial Classes andSolution explorer

Partial Classes andSolution explorer

Scheduled Pinned Locked Moved Visual Basic
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.
  • N Offline
    N Offline
    nishkarsh_k
    wrote on last edited by
    #1

    Hello every one. I have a Vb 2005 express application and i am using partial classes. The application works fine. I had a observation that in the solution explorer the partial class is shown as a new form and there is no designer and resx file. When i double click the partial class file it shows a blank form. What i was assuming that it should come under the class for which i have declared it as partial class and not as a independent form Diagrammatically what the solution explorer has + -- frmMain.vb . |-- frmMain.Designer.vb . |-- frmMain.resx ---- frmMainPartial.vb What i was expecting was + -- frmMain.vb . |-- frmMain.Designer.vb . |-- frmMain.resx . |-- frmMainPartial.vb I am concern that had i implemented the partial class the right way and the solution explorer is showing the right thing or i am wrong at some place Regards Nishkarsh

    L 1 Reply Last reply
    0
    • N nishkarsh_k

      Hello every one. I have a Vb 2005 express application and i am using partial classes. The application works fine. I had a observation that in the solution explorer the partial class is shown as a new form and there is no designer and resx file. When i double click the partial class file it shows a blank form. What i was assuming that it should come under the class for which i have declared it as partial class and not as a independent form Diagrammatically what the solution explorer has + -- frmMain.vb . |-- frmMain.Designer.vb . |-- frmMain.resx ---- frmMainPartial.vb What i was expecting was + -- frmMain.vb . |-- frmMain.Designer.vb . |-- frmMain.resx . |-- frmMainPartial.vb I am concern that had i implemented the partial class the right way and the solution explorer is showing the right thing or i am wrong at some place Regards Nishkarsh

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The solution-explorer doesn't group the files by the namespace or classes that are declared therein. The grouping can't be changed from the IDE as far as I know, but you can edit the Project file manually (or create a cool tool to do so). Here are the steps to get the Solution Explorer to display it your way; * Locate the projectfile (*.vbproj) and open in using notepad. * Find the line that links the file with the partial class to the project. It probably called "frmMainPartial";

      <Compile Include="frmMainPartial.vb" />

      * Now change it so it looks similar to the entry for the resource-file. It should become something like this;

      <Compile Include="Class1.vb">
      <DependentUpon>Form1.vb
      </Compile>

      Or, using your formnames;

      <Compile Include="frmMainPartial.vb">
      <DependentUpon>frmMain.vb</DependentUpon>
      </Compile>

      Enjoy :)

      I are troll :)

      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