Results 1 to 10 of 10

Thread: [2005] Code Snippets - application level

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2008
    Location
    Jacksonville, Florida
    Posts
    147

    Question [2005] Code Snippets - application level

    I'd like to make a few code snippets that come up only in a certain solution or project (even better). I don't want to spam myself with code snippets globally that are only relevant to a project, but are used very often in that project/solution.

    Is this possible? How?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: [2005] Code Snippets - application level

    Spam yourself with code snippets? Assign a shortcut to your code snippets and then you insert them using that shortcut. For instance, I created code snippets for the MessageBox.Show method with 1, 2, 3 and 4 parameters. I used the shortcuts mb1, mb2, mb3 and mb4. I just typed those characters and hit Tab and shazzam!
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2008
    Location
    Jacksonville, Florida
    Posts
    147

    Re: [2005] Code Snippets - application level

    certainly, and for my global shortcuts I do memorize the shortcut, but for indexing purposes when I want to look at my snippets in the ctrl k+ctrl x menuing system...

    can I mark a namespace under mysnippets for all the snippets in a particular project or something like that?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: [2005] Code Snippets - application level

    As you can see, Ctrl+K, Ctrl+X does list snippets as a hierarchical tree. You can add branches to that tree for specific projects if you want. There's no way to limit snippets to a specific project but you simply wouldn't expand that branch in other projects.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Sep 2008
    Location
    Jacksonville, Florida
    Posts
    147

    Re: [2005] Code Snippets - application level

    would I add the branches using folders or a namespace tag in XML? that would be an acceptable solution for what I'm aiming for.

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: [2005] Code Snippets - application level

    I actually haven't used the code snippet editor for quite a while so I can't recall all the details but isn't the tree on the left hand side of the window and you just select the branch you want to add to?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Sep 2008
    Location
    Jacksonville, Florida
    Posts
    147

    Re: [2005] Code Snippets - application level

    I couldn't find a working code snippet editor, I've been doing all my editing by hand.

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: [2005] Code Snippets - application level

    Holy guacamole! Just use THE code snippet editor.

    http://msdn.microsoft.com/en-us/vbasic/ms789085.aspx
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  9. #9
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: [2005] Code Snippets - application level

    Here's a tutorial. I think it's the one I used many moons ago.

    http://www.windowsdevcenter.com/pub/...r-vb-2005.html
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Sep 2008
    Location
    Jacksonville, Florida
    Posts
    147

    Re: [2005] Code Snippets - application level

    I found that link, and the snippdog link yesterday. When I try to run that it says Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item.

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