keyboard shortcut

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jay123
    New Member
    • Sep 2008
    • 121

    keyboard shortcut

    i really need this

    i have 10 lines of code in c#, now what i want to do is comment them all..

    i know one solution go to everyline and put // in front it, fine.
    but is their anyway that i can select that 10 keys press some key from keyboard and all 10 lines gets commented and vice-versa??

    Thanks.
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    In Visual Studio, there is a Comment/Uncomment set of buttons.

    Highlight the lines you want commented, and push the button.

    Here's a pic. Notice the highlighted button.

    Comment

    • jkmyoung
      Recognized Expert Top Contributor
      • Mar 2006
      • 2057

      #3
      This is doable in most development environments. Which one are you using?

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        I just assumed that since he mentioned C#, it's VS.

        Comment

        • RedSon
          Recognized Expert Expert
          • Jan 2007
          • 4980

          #5
          Originally posted by jay123
          i really need this

          i have 10 lines of code in c#, now what i want to do is comment them all..

          i know one solution go to everyline and put // in front it, fine.
          but is their anyway that i can select that 10 keys press some key from keyboard and all 10 lines gets commented and vice-versa??

          Thanks.
          Why would you just not use a block comment?
          Code:
           /*...*/

          Comment

          • jay123
            New Member
            • Sep 2008
            • 121

            #6
            thanks everyone.. as i have just started my programming career so trying to learn all the shortcuts..

            Cheers

            Comment

            • uogen
              New Member
              • Jan 2009
              • 18

              #7
              Hi,
              to make 10 line comment make /*before first line and after the line number ten make */ after you make this ,the color for ten lines will be green
              /* line1





              line10 */
              to cancel comment remove this sign(/* */)

              i hope this help you

              Comment

              Working...