Fundamentals of Microsoft Visual Studio

Introduction

Microsoft Visual Studio is a huge integrated environment (IDE) that allows you to create various types of applications. To take good advantage of it, you should be familiar with what it offers. As you may know already, to launch Microsoft Visual Studio, on the Start menu, you would click Start. If you scroll down, you should see Visual Studio option. You can then click it.

When Microsoft Visual Studio comes up, it displays a splash screen:

Microsoft Visual Studio - Splash Screen

The splash screen displays briefly and closes itself.

The Start Window

When you start Microsoft Visual Studio, after the splash screen, a dialog box displays. That dialog box is named the Start Window:

Microsoft Visual Studio - Start Window

That window allows you to specify what you want to do. If you are not ready to do anything particular, you can click Continue Without Code. This would present an empty Microsoft Visual Studio ready for many options:

Microsoft Visual Studio

Practical LearningPractical Learning: Starting Microsoft Visual Studio

  1. Start Microsoft Visual Studio
  2. On the Visual Studio dialog box, click Continue Without Code

Fundamentals of Files

Introduction

One of the most common features of an IDE is to help you manage files. Microsoft Visual Studio provides many options related to files. This means that Microsoft Visual Studio supports various types of files.

Creating a File

Probably the most fundamental operation you can perform in an IDE is to work on documents. Of course, you must have a document. Microsoft Visual Studio allows you to create various types of documents. To start, you can create a file.

To start a document:

Any of these operations would display the New File dialog box. From that dialog box, you can choose the type of document you want. After making your selection, click Open. This operation would display a document. Depending on the option you had selected, you may be presented with a blank document that you would fill any way you want. Other options would produce a document with some primary content that you can modify as you see fit.

Practical LearningPractical Learning: Creating Files

  1. To get a document, on the main menu of Microsoft Visual Studio, click File -> New -> File...
  2. In the New File dialog box, in the left frame, make sure General is selected.
    In the middle list, click HTML Page:

    Microsoft Visual Studio - New File

  3. Click Open

Saving Files

Introduction

If you start by creating a document as we saw above, if you want to keep that document in your computer or on a drive, you must save the document.

To save file, you have two primary options. If you were working on a brand new document, to save it and make it a file:

Any of these actions would display the Save File As dialog box.

Saving a New File

When saving a file, the computer would need two required pieces of information and an optional piece of information. The first required piece of information you must provide is the combination of a drive and a folder. When saving a document, in the Save File As dialog box, you will be asked to select the drive. After selecting a drive, you can then either select a folder or create a new one and select it. If you want to create a new folder, you can click the New Folder button on the toolbar of the Save File As dialog box.

The second required piece of information you must provide is a name for the file. To provide that information, you can type a name in the File Name combo box.

The optional piece of information you should provide in the Save File As dialog box is a file extension. When saving a document, Microsoft Visual Studio is equipped to identify the default extension to apply to your file. In most cases, you can let Microsoft Visual Studio take care of the extension. In some cases, you will want to suggest the extension to use. You have many options.

Depending on the type of file you had selected in the New File dialog box, when saving a file, in the Save File As dialog box, click the arrow of the Save As Type combo box to see the available types of files supported and their extensions.

Consider the following scenario. By default, if you had selected the HTML Page in the New File dialog box, if you save the file by giving only a name, Microsoft Visual Studio would add the .html extension. If you want another extension, such as .htm, you would have to manually add that extension.

Practical LearningPractical Learning: Saving a File

  1. Make sure the HTML file you created is displaying.
    On the main menu of Microsoft Visual Studio, click File and click Save HTMLPage1.html
  2. In the top combo box of the Save File As dialog box, select the drive of your choice
  3. Click the New Folder button
  4. Type StellarWaterPoint as the name of the folder
  5. Press Enter twice (to save the name and to select it)
  6. Click the File Name combo box and type index as the new name of the file:

    Save File As

  7. Click Save
  8. Change the document and class as follows:
    <!DOCTYPE html>
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" />
    
        <title>Stellar Water Point</title>
    </head>
    <body>
    
    </body>
    </html>
  9. Use a file explorer to access the above StellarWaterPoint folder. In that folder, create a folder named Images
  10. Add the following photos to that Images folder:

    Stellar Water Point - Water Bills Stellar Water Point - Customers Accounts
    Stellar Water Point - Water Meters Stellar Water Point - Community Services
    Stellar Water Point - Legal Affairs Stellar Water Point - Employees Portal


    Return to Microsoft Visual Studio

Saving an Existing File

If a document was previously saved, it would now become a file. If you want to save it, perform one of the above actions. In that case, the file would be transparently saved (the Save File As dialog box would not display.

Practical LearningPractical Learning: Passing Argument by Reference

  1. In Microsoft Visual Studio, to save the file, on the Standard toolbar, click the Save button Save
  2. To start another document, press Ctrl + N
  3. In the middle list of the New File dialog box, click Style Sheet
  4. Click Open
  5. To save the file, on the Standard toolbar, click the Save button Save
  6. In the top combo box, make sure the StellarWaterPoint folder that was previously created is selected.
    Click the New Folder button
  7. Type Styles as the name of the folder
  8. Press Enter twice
  9. Click the File Name combo box and type Home as the new name of the file:

    Save File As

  10. Click Save
  11. Change the document as follows:
    body {
        background-color: antiquewhite;
    }
    
    .maroon             { color:            maroon;        }
    
    .menubar            { list-style-type:  none;
                          margin:           auto;
                          padding:          0;
                          background-color: #800000;
                          display:          flex;
                          border:           1px solid red; }
    .menubar li a       { display:          block;
                          color:            white;
                          text-align:       center;
                          padding:          14px 16px;
                          text-decoration:  none;          }
    .menubar li a:hover { background-color: #ff6a00;       }
  12. To start a new document, press Ctrl + N
  13. In the middle list of the New File dialog box, double-click Style Sheet
  14. To save the file, on the Standard toolbar, click the Save button Save
  15. In the top combo box, make sure the StellarWaterPoint/Styles folder is selected.
    As the name of the file is selected, type Navigation to replace the name of the file
  16. Click Save
  17. Change the document as follows:
    body {
        background-color: white;
    }
    
    .encloser  { margin:           auto;
                 width:            350px; }
    .enclosing { margin:           auto;
                 width:            450px; }
    .common-font {
        font-family: Garamond, Georgia, Cambria, 'Times New Roman', Times, serif
    }
  18. To start a new document, on the main menu of Microsoft Visual Studio, click File -> New -> File...
  19. In the middle list of the dialog box, click HTML Page
  20. Click Open
  21. To save the file, on the Standard toolbar, click the Save button Save
  22. In the top combo box, select the StellarWaterPoint folder to display the root folder of the project
  23. Click the New Folder button
  24. Type HumanResources as the name of the folder
  25. Press Enter twice
  26. Select the string in the File Name combo box and type Employees to replace the name of the file
  27. Click Save
  28. To start a new document, on the main menu of Microsoft Visual Studio, click File -> New -> File...
  29. In the middle list of the dialog box, click HTML Page
  30. Click Open
  31. To save the file, on the Standard toolbar, click the Save button Save
  32. In the top combo box, make sure the StellarWaterPoint/HumanResources folder is displaying.
    As the string in the File Name combo box is selected (if not, select it) and type PayrollEvaluation to replace the name of the file
  33. Click Save
  34. To start a new document, on the Standard toolbar, click the New File button New File
  35. In the middle list of the New File dialog box, click JavaScript File
  36. Press Enter
  37. To save the document, press Ctrl + S
  38. In the top combo box of the Save File As dialog box, make sure StellarWaterPoint/HumanResources is selected.
    On the toolbar of the Save File As dialog box, click the New Folder button
  39. Type Scripts as the name of the folder
  40. Press Enter twice
  41. Select the string in the File Name combo box and type PayrollEvaluation to replace the name of the file
  42. Click Save
  43. In the empty document, type the following code:
    function EvaluatePayroll() {
        const strFirstName = document.PayrollEvaluation.txtFirstName.value;
        const strLastName  = document.PayrollEvaluation.txtLastName.value;
    
        const hourlySalary = Number(document.PayrollEvaluation.txtHourlySalary.value);
    
        const monday       = Number(document.PayrollEvaluation.txtMonday.value);
        const tuesday      = Number(document.PayrollEvaluation.txtTuesday.value);
        const wednesday    = Number(document.PayrollEvaluation.txtWednesday.value);
        const thursday     = Number(document.PayrollEvaluation.txtThursday.value);
        const friday       = Number(document.PayrollEvaluation.txtFriday.value);
    
        const totalTime    = monday + tuesday + wednesday + thursday + friday;
        const ovtSalary    = hourlySalary * 1.5;
    
        var regularTime    = 0.00;
        var overTime       = 0.00;
        var regularPay     = 0.00;
        var overtimePay    = 0.00;
    
        if (totalTime < 40) {
            regularTime    = totalTime;
            regularPay     = hourlySalary * totalTime;
            overTime       = 0.00;
            overtimePay    = 0.00;
        }
        else // if (totalTime >= 40)
        {
            regularTime    = 40;
            overTime       = totalTime - 40;
            regularPay     = hourlySalary * 40;
            overtimePay    = overTime * ovtSalary;
        }
    
        document.PayrollEvaluation.txtEmployeeName.value = strFirstName + " " + strLastName;
    
        document.PayrollEvaluation.txtRegularTime.value  = regularTime.toFixed(2);
        document.PayrollEvaluation.txtOverTime.value     = overTime.toFixed(2);
        document.PayrollEvaluation.txtRegularPay.value   = regularPay.toFixed(2);
        document.PayrollEvaluation.txtOvertimePay.value  = overtimePay.toFixed(2);
        document.PayrollEvaluation.txtNetPay.value       = (regularPay + overtimePay).toFixed(2);
    }
  44. To start a new document, on the main menu of Microsoft Visual Studio, click File -> New -> File...
  45. In the middle list of the New File dialog box, make sure click JavaScript File is selected.
    Click Open
  46. To save the file, on the Standard toolbar, click the Save button Save
  47. Make sure the top combo box of the dialog box is displaying StellarWaterPoint/HumanResources/Scripts.
    Change the name of the file to Employees
  48. Click Save
  49. In the document, type the following code:
    const employees = [
        { employeeNumber: 379492, firstName: "Barbara",   lastName: "Martins", hourlySalary: 32.17 },
        { employeeNumber: 740317, firstName: "Michael",   lastName: "Carlock", hourlySalary: 24.68 },
        { employeeNumber: 503582, firstName: "Charlotte", lastName: "Brown",   hourlySalary: 27.73 },
        { employeeNumber: 394131, firstName: "Andrew",    lastName: "Marlow",  hourlySalary: 18.68 },
        { employeeNumber: 483794, firstName: "Roland",    lastName: "Dobson",  hourlySalary: 27.73 }
    ];
  50. To start a new document, press Ctrl + N
  51. In the middle list of the New File dialog box, make sure click JavaScript File is selected.
    Click Open
  52. To save the file, on the Standard toolbar, click the Save button Save
  53. Make sure the top combo box of the dialog box is displaying StellarWaterPoint/HumanResources/Scripts.
    Change the name of the file to Read
  54. Click Save
  55. In the document, type the following code:
    const tableBody = document.querySelector("#employeeTable tbody");
    
    tableBody.innerHTML = "";
    
    employees.forEach(emp => {
        const row = document.createElement("tr");
    
        row.innerHTML = `
        <td style="text-align: center">${emp.employeeNumber}</td>
        <td>${emp.firstName}</td>
        <td>${emp.lastName}</td>
        <td style="text-align: right">$${emp.hourlySalary.toFixed(2)}</td>
      `;
    
        tableBody.appendChild(row);
    });
  56. To start a new document, on the Standard toolbar, click the arrow of the New File button. From the list that appears, click New File:

    New File

  57. In the middle list of the New File dialog box, click Sql File
  58. Click Open
  59. To save the document, press Ctrl + S
  60. In the top combo box of the New File dialog box, click StellarWaterPoint to display the root folder
  61. On the toolbar of the dialog box, click the New Folder button
  62. Type Data as the name of the folder
  63. Press Enter twice
  64. Select the string in the File Name combo box and type StellarWaterPoint to replace the name of the file
  65. Click Save
  66. Change the document as follows:
    CREATE DATABASE StellarWaterPoint;
    GO
    USE StellarWaterPoint;
    GO
    
    CREATE TABLE WaterMeters
    (
        WaterMeterID INT IDENTITY(1, 1),
        MeterNumber  NVARCHAR(15) NOT NULL,
        Make         NVARCHAR(25)     NULL,
        [Model]      NVARCHAR(15) NOT NULL,
        MeterSize    NVARCHAR(15),
        CONSTRAINT   PK_WaterMeters PRIMARY KEY(WaterMeterId)
    );
    GO
  67. To start a new document, on the main menu of Microsoft Visual Studio, click File -> New -> File...
  68. In the middle list of the New File dialog box, double-click XML File
  69. Press Enter twice
  70. To save the document, press Ctrl + S
  71. In the top combo box of the New File dialog box, make sure StellarWaterPoint/Data is displaying.
    Select the string in the File Name combo box and type WaterMeters to replace the name of the file
  72. Click Save
  73. Change the document as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <water-meters>
        <water-meter>
            <meter-number>392-494-572</meter-number>
            <make>Constance Technologies</make>
            <model>TG-4822</model>
            <meter-size>5/8 Inches</meter-size>
        </water-meter>
        <water-meter>
            <meter-number>938-725-869</meter-number>
            <make>Stanford Trend</make>
            <model>266G</model>
            <meter-size>1 1/2 Inches</meter-size>
        </water-meter>
        <water-meter>
            <meter-number>588-279-663</meter-number>
            <make>Estellano</make>
            <model>NCF-226</model>
            <meter-size>4 Inches</meter-size>
        </water-meter>
        <water-meter>
            <meter-number>186-962-805</meter-number>
            <make>Lansome</make>
            <model>2800</model>
            <meter-size>1 1/2 Inches</meter-size>
        </water-meter>
    </water-meters>

Creating and Saving a Text-Based Document

When using Microsoft Visual Studio, you can create and save the file from almost any text-based document. To procede, display the New File dialog box as we saw previously. In the middle list, click Text File and click Open. Edit the document with any content of your choice based on the type of file you want to get. When saving the document, you can apply the extention of almost any type that is text based. To do that, when saving the file, put its name and extension in double-quotes.

Saving many Files

One of the advantages of using a programming environment is the number of options it offers. One common option is the ability to save many files with one action. To save many files in one action:

When you perform any of these actions, Microsoft Visual Studio would check the saving status of each file that is currently used. Going through the list of document, if Microsoft Visual Studio reaches a document and finds out that the document was previously saved, which means the document already has a name, if the document was not changed since the last time it was saved, Microsoft Visual Studio would not do anything and would move to the next document. If a file was saved, then it was modified, Microsoft Visual Studio would save the changed file using its drive, its folder, its name, and its extension. If a document is brand new and was not previously saved, Microsoft Visual Studio would display the Save File As dialog box.

Practical LearningPractical Learning: Saving many Files

Opening a File

Introduction

Microsoft Visual Studio primarily behaves as a text-based application. As a result, it allows you to open any text-based file, starting with those from programming languages: C#, C++, Visual Basic, Python, HTML, CSS, JavaScript, SQL, etc. To open a file:

Any of these actions would display the Open File dialog box. From there, you can locate and select the desired file. Then click Open.

Opening any File

As mentioned previously, Microsoft Visual Studio supports various types of files. As a result, you can open various types of files, including graphics files. When opening a file, if the file is easily recognizable, Microsoft Visual Studio would open it and display its contents. If you open a complex file, Microsoft Visual Studio would display a warning message box requesting your permission:

Microsoft Visual Studio - Opening a File - A Warning

If you click Yes on the message box, Microsoft Visual Studio would open and display the file. If you click No, nothing else would happen.

If you select a file that Microsoft Visual Studio cannot open or doesn't want to open, it would display an error message box:

Microsoft Visual Studio - Opening a File - An Error Message

Opening a Recent File

Microsoft Visual Studio keeps a list of files that were previously opened. To see that list, on the main menu of Microsoft Visual Studio, click File and position the mouse on Recent Files. By default, Microsoft Visual Studio keeps a list of the ten files that were recently opened. To manage this number, on the main menu of Microsoft Visual Studio, click Tools and click Options... If you want, change the value of the Items To Show In Recent Used File List:

Locals

Opening by Dragging

If Microsoft Visual Studio supports a certain type of file, to open such a file, you can drag it from a file explorer and drop it in the Code Editor.

Opening many Files

Microsoft Visual Studio is a multiple-document interface (MDI) application. One of the advantages of such an application is that they allow you to open more than one document. To proceed, display the Open file dialog box using one of the options we reviewed. In that dialog box, click a file. Then use either the Shift or the Ctrl key to select the files. When the selections have been made, click Open.

Accessing a File

Introduction

As you might have found out, you can have many files in Microsoft Visual Studio. To perform an action on a particular document, you must access its file. Microsoft Visual Studio provides many options.

Open With

In the Open With dialog box, click the desired editor and click OK.

Accessing a File from Window

The main menu of Microsoft Visual Studio is equipped with a menu category titled Window. Besides some items that are used to manage some window options, the Window menu item holds a list (or collection) of the files that are currently opened in Microsoft Visual Studio. Every time you open a file, the name (and path) of that file is added to the Window list. To see the list of files, click Window. Each entry displays with an ordered number and the path to the file.

By default, the Window menu item displays 10 items. This number is controlled in the Tools window. To change it, on the main menu of Microsoft Visual Studio, click Tools and click Options. Set the desired number in the Items To Show In Window Menu:

Microsoft Visual Studio - Options

To allow you to see other files, the Window menu is equipped with an item titled Windows... As is a convention in Microsoft Windows operating systems, the three periods (...) indicate that if you click that menu item, a window, in this case a dialog box, would open. In this case, the dialog box would display two columns in a list view and a few buttons:

Windows

Practical LearningPractical Learning: Accessing a File from Window

  1. On the main menu of Microsoft Visual Studio, click Window
  2. In the list that appears, click StellarWaterPoint/HumanResources/Employees.html
  3. Change the document as follows:
    <!DOCTYPE html>
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8" />
    
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" type="text/css" href="../Styles/Navigation.css" />
        
        <title>Employees Records</title>
    </head>
    <body>
        <h1 class="text-center fw-bold common-font">Employees Records</h1>
    
        <hr />
    
        <section class="enclosing common-font">
            <table id="employeeTable" border="1" align="center">
                <thead>
                    <tr>
                        <th>Employee #</th>
                        <th>First Name</th>
                        <th>Last Name</th>
                        <th>Hourly Salary</th>
                    </tr>
                </thead>
                <tbody>
                    <!-- Placeholder of a list of employees -->
                </tbody>
            </table>
        </section>
    
        <script src="Scripts/Employees.js"></script>
        <script src="Scripts/Read.js"></script>
    </body>
    </html>
  4. On the main menu of Microsoft Visual Studio, click Window and click Windows...
  5. In the list box of the Windows dialog box, click PayrollEvaluation.html
  6. Click OK
  7. Change the document as follows:
    <!DOCTYPE html>
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8" />
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" />
        <link href="../Styles/Manage.css" rel="stylesheet" type="text/css" />
        
        <title>Payroll Evaluation</title>
    </head>
    <body>
        <h3 class="display-4 text-center fw-bold common-font">Payroll Evaluation</h3>
    
        <hr />
    
        <form name="PayrollEvaluation" method="post" class="common-font encloser">
            <div class="row mb-2">
                <label for="txtFirstName" class="col-form-label col-sm-5 fw-bold">First Name:</label>
                <div class="col-sm-7">
                    <input name="txtFirstName" class="form-control" />
                </div>
            </div>
    
            <div class="row mb-2">
                <label for="txtLastName" class="fw-bold col-sm-5 col-form-label">Last Name:</label>
                <div class="col-sm-7">
                    <input name="txtLastName" class="form-control" />
                </div>
            </div>
    
            <div class="row mb-2">
                <label for="txtHourlySalary" class="fw-bold col-sm-5 col-form-label">Hourly Salary:</label>
                <div class="col-sm-7">
                    <input name="txtHourlySalary" class="form-control" />
                </div>
            </div>
    
            <div class="row mb-2">
                <label for="txtMonday" class="fw-bold col-sm-5 col-form-label">Monday:</label>
                <div class="col-sm-7">
                    <input name="txtMonday" class="form-control" />
                </div>
            </div>
    
            <div class="row mb-2">
                <label for="txtTuesday" class="fw-bold col-sm-5 col-form-label">Tuesday:</label>
                <div class="col-sm-7">
                    <input name="txtTuesday" class="form-control" />
                </div>
            </div>
    
            <div class="row mb-2">
                <label for="txtWednesday" class="fw-bold col-sm-5 col-form-label">Wednesday:</label>
                <div class="col-sm-7">
                    <input name="txtWednesday" class="form-control" />
                </div>
            </div>
    
            <div class="row mb-2">
                <label for="txtThursday" class="fw-bold col-sm-5 col-form-label">Thursday:</label>
                <div class="col-sm-7">
                    <input name="txtThursday" class="form-control" />
                </div>
            </div>
    
            <div class="row mb-2">
                <label for="txtFriday" class="fw-bold col-sm-5 col-form-label">Friday:</label>
                <div class="col-sm-7">
                    <input name="txtFriday" class="form-control" />
                </div>
            </div>
    
            <div class="row mb-2">
                <label class="fw-bold col-sm-6 col-form-label"></label>
                <div class="col-sm-6">
                    <input type="button" value="Calculate" id="btnCalculate" onclick="EvaluatePayroll()" class="btn btn-primary" />
                </div>
            </div>
    
            <hr />
    
            <div class="row mb-2">
                <label for="txtEmployeeName" class="fw-bold col-sm-5 col-form-label">Employee Name:</label>
                <div class="col-sm-7">
                    <input class="form-control" name="txtEmployeeName" />
                </div>
            </div>
    
            <div class="row mb-2">
                <label for="txtRegularTime" class="fw-bold col-sm-5 col-form-label">Regular Time:</label>
                <div class="col-sm-7">
                    <input id="txtRegularTime" class="form-control" />
                </div>
            </div>
    
            <div class="row mb-2">
                <label for="txtOverTime" class="fw-bold col-sm-5 col-form-label">Over Time:</label>
                <div class="col-sm-7">
                    <input id="txtOverTime" class="form-control" />
                </div>
            </div>
    
            <div class="row mb-2">
                <label for="txtRegularPay" class="fw-bold col-sm-5 col-form-label">Regular Pay:</label>
                <div class="col-sm-7">
                    <input id="txtRegularPay" class="form-control" />
                </div>
            </div>
    
            <div class="row mb-2">
                <label for="txtOvertimePay" class="fw-bold col-sm-5 col-form-label">Overtime Pay:</label>
                <div class="col-sm-7">
                    <input id="txtOvertimePay" class="form-control" />
                </div>
            </div>
    
            <div class="row mb-2">
                <label for="txtNetPay" class="fw-bold col-sm-5 col-form-label">Net Pay:</label>
                <div class="col-sm-7">
                    <input id="txtNetPay" class="form-control" />
                </div>
            </div>
        </form>
        <script src="Scripts/PayrollEvaluation.js"></script>
    </body>
    </html>

To open a file, click it and click Activate.

Navigating among the Files

Introduction

You are probably aware that, when you use a browser to access the Internet, you can access the page you recently visited by clicking the previous button. If you previously visited a page and moved back, you can visit the page that is considered the next one. Microsoft Visual Studio provides the same capability. To make this possible, Microsoft Visual Studio keeps an ordered list of documents that are accessed.

Navigating Backward

To access a document that was just recently used:

Navigating Forward

To access a document that is positioned ahead of the current document:

Navigating by Selection

As you may realize, navigating is limited to the document that was just previously accessed. If you want to navigate to the document that was far accessed, you have to keep navigating backward or forwoard, one document at a time. Microsoft Visual Studio provides a better solution. To use it, press and hold Ctrl. Then press Tab and release while you are still holding Ctrl. This would present a window that contains a list of all the files that are currently opened:

Documents Navigator

While you are still holding Ctrl, keep pressing Tab until the desired file is selected. Then release both Ctrl and Tab. The file that was selected would then display.

Fundamentals of Tabs

Introduction

As you should be aware already, every time you create or open a file, Microsoft Visual Studio creates a tab for that file. Microsoft Visual Studio provides many options to manage those tabs.

To manage the tabs:

In both cases, refer to the options in the Tabs section:

Options - Tabs

Accessing a Tab

As you should know by now, to access a document that is represeted with a tab, you can simply click the tab. This action would cause the document to be accessed and displayed. You can then use that document such as simply reading it or editing it.

Practical LearningPractical Learning: Accessing a Tab

  1. Click the index.html to access it
  2. Change the document as follows:
    <!DOCTYPE html>
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="Styles/Home.css" />
        <link rel="stylesheet" href="Styles/Navigation.css" />
        <title>Stellar Water Point</title>
    </head>
    <body class="common-font">
        <header class="text-center container">
            <div>
                <div class="col-md-8 mx-auto">
                    <h1 class="fw-bold maroon">Stellar Water Point</h1>
                    <p class="lead">
                        Stellar Water Point is a commercial company that sells and distributes water to customers residences and private companies. Our water process is socially responsible and community oriented.
                    </p>
                </div>
            </div>
        </header>
    
        <nav class="container">
            <ul class="menubar justify-content-center">
                <li><a href="WaterBills/index.html">Water Bills</a></li>
                <li><a href="Customers/index.html">Customers</a></li>
                <li><a href="WaterMeters/index.html">Water Meters</a></li>
                <li><a href="HumanResources/Employees.html">Employees</a></li>
                <li><a href="ContactUs.html">Contact Us</a></li>
                <li><a href="AboutUs.html">About Us</a></li>
            </ul>
        </nav>
    
        <hr />
    
        <div class="container">
            <div class="row">
                <div class="col-md-4">
                    <div class="card mb-4 box-shadow">
                        <img class="bordered" src="Images/WaterBills.png" alt="Water Bills" />
                        <div class="card-body">
                            <h5><a class="nav-link text-dark fw-bold" href="/WaterBills/Index">Water Bills</a></h5>
                            <hr />
                            <p class="card-text">Water bills are processed in a timely and responsible manner, applying only the strictest, regular, and lawful rules.</p>
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="card mb-4 box-shadow">
                        <img class="bordered card-img-top" src="Images/Customers.png" alt="Customers Accounts" />
                        <div class="card-body">
                            <h5><a class="nav-link text-dark fw-bold" href="/Customers/Index">Customers Accounts</a></h5>
                            <hr />
                            <p class="card-text">Water bills are sent in a trimester-base to each of our customers who holds an account with us, all for good service.</p>
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="card mb-4 box-shadow">
                        <img class="bordered card-img-top" src="Images/WaterMeter.png" alt="Water Meters">
                        <div class="card-body">
                            <h5><a class="nav-link text-dark fw-bold" href="/WaterMeters/Index">Water Meters</a></h5>
                            <hr />
                            <p class="card-text">We use industry standard water meters that are regularly government inspected for their accuracy and precision.</p>
                        </div>
                    </div>
                </div>
    
                <div class="col-md-4">
                    <div class="card mb-4">
                        <img class="card-img-top bordered" src="Images/Community.png" alt="Community Services">
                        <div class="card-body">
                            <h5><a class="nav-link text-dark fw-bold" href="/StellarWaterPoint">Community Services</a></h5>
                            <hr />
                            <p class="card-text">Stellar Water Point is a community-oriented company that works withn various local activities and authorities.</p>
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="card mb-4">
                        <img class="card-img-top bordered" src="Images/LegalAffairs.png" alt="Legal Affairs">
                        <div class="card-body">
                            <h5><a class="nav-link text-dark fw-bold" href="/StellarWaterPoint">Legal Affairs</a></h5>
                            <hr />
                            <p class="card-text">Issues of regulations and government affairs are addressed here. This is available for employees, contractors, etc.</p>
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="card mb-4">
                        <img class="card-img-top bordered" src="Images/Employees.png" alt="Employees Portal">
                        <div class="card-body">
                            <h5><a class="nav-link text-dark fw-bold" href="HumanResources/PayrollEvaluation.html">Employees Portal</a></h5>
                            <hr />
                            <p class="card-text">This is a central area form employees to access the company resources such as time sheets, payroll, benefits, etc.</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    
        <footer class="border-top footer text-muted">
            <div class="container">
                <p class="common-font text-center">&copy; 2026 - Stellar Water Point</p>
            </div>
        </footer>
    </body>
    </html>

The Selected Tab and its Path

You may already be aware that you can open many files in Microsoft Visual Studio, and each document would be represented by a tab. To know the path of a file, position the mouse on its tab (you don't have to click the tab). A tooltip would display the tab. Here are two examples:

The Path of a File

The Path of a File

Managing the Tabs

Introduction

Every time you start a document or open a file in Microsoft Visual Studio, a tab is added for it. Microsoft Visual Studio provides many options to manage the tabs. At any time, one thing you can do is to right-click a tab. A menu with many options would display:

Microsoft Visual Studio - The Tab of the Code Editor

The Rows of Tabs

The tabs are added from the left to the right above the Code Editor. The number of tabs depends on the monitor resolution you are using.

Using Multiple Rows of Tabs

When the area allocated to the tabs becomes full, the next new tabs would be added but would be hidden. A solution is to show the tabs in various rows. To make it happen, you have two options:

Practical LearningPractical Learning: Using Multiple Rows of Tabs

  1. On the right side of the tabs above the Code Editor, click the Settings button and click Show Tabs In Multiple Rows

The Positions of Tabs

By default, the tabs display horizontally in the top section of the Code Editor. As an alternative, you can position them to the left or the right side of the Code Editor. You have two options:

Revealing or Hiding Multiple Rows of Tabs

After allowing the Code Editor to show multiple tabs, you have the option of showing one row of tabs or multiple rows. To to that, position the mouse on the row of tabs, and roll the mouse wheel.

Accessing an Active Document

As you should know now, to access a document, you can click its tab. If you have many documents, it can be difficult to find the one you want. As an alternative, you can use the Active Files button Active Files on the tabs above the Code Editor.

Practical LearningPractical Learning: Accessing a Tabbed File

  1. On the right side of the tabs, click the Active Files button Active Files
  2. In the list that appears, click Navigation.css
  3. Change the document as follows:
    body {
        background-color: white;
    }
    
    .encloser  { margin:           auto;
                 width:            350px; }
    
    .enclosing { margin:           auto;
                 width:            450px; }
    
    table      { border-collapse:  collapse;
                 border-top:       3px solid gray;
                 border-bottom:    3px solid gray;   }
    thead      { background:       #F0F0F0;
                 border-block-end: 2px solid;        }
    
    tfoot      { background:       gray;
                 border-block:     2px solid;        }
    th, td     { padding:          0.25rem 0.75rem;
                 border:           1px solid silver; }
                 
    .common-font {
        font-family: Garamond, Georgia, Cambria, 'Times New Roman', Times, serif
    }
  4. To save all files, on the Standard toolbar of Microsoft Visual Studio, click the Save All button  Save All
  5. From a file Explorer, locate the StellarWaterPoint point of the above files. Double-click the index.html file:

    Services

    If you want, click the top Employees link. Then click the Back button. Then click the bottom Employees link.
  6. Close the browser and return to your programming environment (for the rest of this lesson, perform the instructions in the below sections)

Closing the Tabs

Closing a Tab

If you don't want a file to be represented anymore by its tab, you can remove its tab. To close a file by its tab, you have many options:

Closing Other Tabs

If you have more than one tab that are currently displaying, you have the option of closing all tabs except one. To proceed, click the tab you want to keep. Right-click that tab and click Close Other Tabs.

Closing all Tabs

If you don't want to display any tab at all, you can close all tabs. To close all tabs:

Getting Help

Introduction

Microsoft corporation, Microsoft Visual Studio, and the Internet provide various types of help to assist you with writing code and creating applications. Microsoft, as a company provides a huge website with thousands or hundreds of thousands of documents. Microsoft Visual Studio comes with many tools you can use. As you should know already, one of the precious available tools is the Intellisense. Once you start typing, the Intellisense presents many options from which you can make a selection.

About Microsoft Visual Studio

Microsoft Visual Studio provides a dialog box named About. To access ot, on the main menu of Microsoft Visual Studio, click Help and click About Microsoft Visual Studio:

About Microsoft Visual Studio

Notice that the dialog box provides many valuable pieces of information. The dialog box displays the type of installation of Microsoft Visual Studio, the last update the installation received, and more importantly, the version of Microsoft Visual Studio that you are using.

Getting Help from Code

There are various ways Microsoft Visual Studio can assist you with code. One way is by providing you information about the code on a document.

When you are writing your code, such as declaring a variable, creating a layout (a namespace, an interface, a class, a record, a structure, an enumeration, etc), deriving a class or an interface, creating a conditional statement, etc, we assume that you know what you are doing. In some cases, when you start an application, depending on the type of project, Microsoft Visual Studio creates many files (and sub-folders) and it generates many code pieces for you:

To create any of these actions, you should analyse the code that Microsoft Visual Studio generated for you, or you should understand that code, or you should be familiar with that. Sometimes you are not familiar with that code (maybe because you are studying a topic or you are trying to get familiar with a certain type of application). Sometimes you simply don't understand what that code does. Microsoft Visual Studio has many ways to assist you.

When you are looking at code in the Code Editor, if you see a word you don't understand or you are simply curious, the first thing you should do is to position your mouse on that word. A tool tip would appear:

Code Editor - Tool Tip Help

Notice that the tooltip in this case defines the type of thing under the mouse, and it provides a description of that item. In most cases, after positioning the mouse on an item, in the tooltip that appears, position your mouse on each of the items. Some of the items are links. You would know if the item becomes underlined when you position the mouse on it. Here are examples:

Code Editor - Tool Tip Help

Code Editor - Tool Tip Help

Code Editor - Tool Tip Help

Based on this, if you position your mouse on an item and the item becomes underlined, which means there is a link, if you want to get more information about the item that is underlined, click it. Microsoft Visual Studio would open a webpage related to that item. Here is an example from clicking Console:

Code Editor - Tool Tip Help

Notice that the tab of that window displays "compiled" and a lock. This means that you cannot change anything in that document.

Getting Online Help

Online help consists of getting assistance from published documents. In the past, a typical application shipped with a help documentation. It was a separate application that was linked or tied to the main application. To help a user access that help, a typical application had a menu and, on that menu, there was a Help item on its top-right section. As you probably aware and as you can see from the main menu of Microsoft Visual Studio, most desktop applications still have a Help menu category. If the user clicks that Help menu item, a list of options should display. Here is an example from Microsoft Visual Studio:

Microsoft Visual Studio - Help

From that list, in Microsoft Visual Studio, two of the options the user can click are Get Help or Technical Support.

F1 Help

In the past, the most common way to access help on an application consisted of pressing F1. The help is still available in most application but its use many depend on the application.

In Microsoft Visual Studio, as one way to access online help, in the Code Editor, click the word for which you want to get help. Then press F1.

Practical LearningPractical Learning: Ending the Lesson

  1. Close Microsoft Visual Studio

Previous Copyright © 2001-2026, FunctionX Sunday 14 December 2025, 14:27 Next