본문 바로가기

카테고리 없음

Mac Visual Code Studio Shortcut For Commenting Out



Yesterday, I was talking with one of the folks here and I learned something about Visual Studio. We were looking at some code and he selected a line, clicked a button, on the toolbar, and the line was commented out. I asked him what he just did and he introduced me to the handy comment / uncomment buttons. For years, I've been a C/C++/C# multi-line comment person, manually adding /* and */ around any code I wanted to temporarily remove. While that is a fast / easy way to comment out a block of code, this is even easier, especially when I discover that I already have a multi-line comment block within the code I wish to disable. For languages which do not support multi-line comments, this saves a lot of time.
To illustrate this feature, I will use the following simple method:
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
Single x = 0f;
Single y = 0f;
String message = '.NET Compact Framework';
SizeF msgSize = g.MeasureString(message, this.Font);
x = (Single)(Screen.PrimaryScreen.Bounds.Width / 2) -
(msgSize.Width / 2);
y = (Single)(Screen.PrimaryScreen.Bounds.Height / 2) -
(msgSize.Height / 2);
g.DrawString(message,
this.Font,
new SolidBrush(Color.Blue),
x, y);
}

Commenting
The above code centers a string message in a Form's OnPaint method. Let's comment out the portion that calculates the string position.

VS Shortcuts| Shortcut keys for Visual Studio. Login Join Now. All Products and Pricing. Marks the current line or selected lines of code as a comment, using the correct comment syntax for the programming language: Ctrl-K, Ctrl-U. Toggles the Command window into or out of a mode allowing text within the window to be selected. For single line comment you can use Ctrl + / and for multiple line comment you can use Ctrl + Shift + / after selecting the lines you want to comment in java editor. On Mac/OS X you can use Cmd + / to comment out single lines or selected blocks.

 

Mac Visual Code Studio Shortcut For Commenting OutShortcut

  1. Highlight the following lines:
    SizeF msgSize = g.MeasureString(message, this.Font);
    x = (Single)(Screen.PrimaryScreen.Bounds.Width / 2) -
    (msgSize.Width / 2);
    y = (Single)(Screen.PrimaryScreen.Bounds.Height / 2) -
    (msgSize.Height / 2);
  2. On the text editor toolbar, click the Comment button (it's the one with the horizontal black and cyan lines)
    Alternately, you can use the keyboard shortcut (Ctrl+K followed by Ctrl+C)

Block Comment Visual Studio Shortcut

 

The method now looks like this:
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
Single x = 0f;
Single y = 0f;
String message '.NET Compact Framework';
//SizeF msgSize = g.MeasureString(message, this.Font);
//x = (Single)(Screen.PrimaryScreen.Bounds.Width / 2) -
// (msgSize.Width / 2);
//y = (Single)(Screen.PrimaryScreen.Bounds.Height / 2) -
// (msgSize.Height / 2);
g.DrawString(message,
this.Font,
new SolidBrush(Color.Blue),
x, y);
}

Uncommenting
Now, let's uncomment the code that centers the message horizontally (leaving it at the top of the form).

 

 

  1. Highlight the following lines:
    //SizeF msgSize = g.MeasureString(message, this.Font);
    //x = (Single)(Screen.PrimaryScreen.Bounds.Width / 2) -
    // (msgSize.Width / 2));
  2. On the text editor toolbar, click the Uncomment button (it's the one with the horizontal black and cyan lines, with a blue reverse arrow)
    Alternately, you can use the keyboard shortcut (Ctrl+K followed by Ctrl+U)

Mac Visual Code Studio Shortcut For Commenting Out In Python

 

Visual Studio For Mac Shortcuts

The method now looks like this:
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
Single x = 0f;
Single y = 0f;
String message '.NET Compact Framework';
SizeF msgSize = g.MeasureString(message, this.Font);
x = (Single)(Screen.PrimaryScreen.Bounds.Width / 2) -
(msgSize.Width / 2));
//y = (Single)(Screen.PrimaryScreen.Bounds.Height / 2) -
// (msgSize.Height / 2));
g.DrawString(message,
this.Font,
new SolidBrush(Color.Blue),
x, y);
}

Enjoy!
-- DK

Disclaimer(s):
This posting is provided 'AS IS' with no warranties, and confers no rights.

Summary With Visual Studio, we can now create amazing Python and Node applications. Microsoft visual studio 2015 community for mac. You can manage your downloaded packages and use interactive shell inside Visual Studio for Python as playground to test things.

For example, programs such as 'MSN Messenger', 'Skype', media players etc. Can tie up inputs/outputs so, close FL Studio, close any program that may use your audio device and re-open FL Studio and the ASIO4ALL options. Jun 19, 2018  What is Asio for all Driver? ASIO4ALL is a hardware independent low latency ASIO driver for WDM audio devices. It uses WDM Kernel-Streaming and sometimes even more sophisticated methods to achieve its objectives. Asio4All is a sound driver, or in other words, it is the platform that FL Studio uses to produce sound from your computer. Option