/// <summary>
        /// Check if the last tab rectangle contains the mouse clicked point, then insert a tab before the last tab.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tabControlConnections_MouseDown(object sender, MouseEventArgs e)
        {
            var lastIndex = tabControlConnections.TabCount - 1;

            if (tabControlConnections.GetTabRect(lastIndex).Contains(e.Location))
            {
                //tabControlConnections.TabPages.Insert(lastIndex, "New Tab");
                TeamConnection connectionProfile = new TeamConnection();
                connectionProfile.ConnectionInternalId = Utility.CreateMd5(new[] { Utility.GetRandomString(100) }, " % $@");
                connectionProfile.ConnectionName       = "New connection";
                connectionProfile.ConnectionKey        = "New";
                connectionProfile.ConnectionType       = ConnectionTypes.Database;

                TeamDatabaseConnection connectionDatabase = new TeamDatabaseConnection();
                connectionDatabase.SchemaName         = "<Schema Name>";
                connectionDatabase.ServerName         = "<Server Name>";
                connectionDatabase.DatabaseName       = "<Database Name>";
                connectionDatabase.NamedUserName      = "******";
                connectionDatabase.NamedUserPassword  = "******";
                connectionDatabase.authenticationType = ServerAuthenticationTypes.NamedUser;

                TeamFileConnection connectionFile = new TeamFileConnection();
                connectionFile.FilePath = @"<File Path>";
                connectionFile.FileName = @"<File Name>";

                connectionProfile.DatabaseServer = connectionDatabase;
                connectionProfile.FileConnection = connectionFile;


                //localCustomTabPage.OnChangeMainText += UpdateMainInformationTextBox;
                //localCustomTabPage.OnClearMainText += (ClearMainInformationTextBox);

                bool newTabExists = false;
                foreach (TabPage customTabPage in tabControlConnections.TabPages)
                {
                    if (customTabPage.Name == "New")
                    {
                        newTabExists = true;
                    }
                    else
                    {
                        // Do nothing
                    }
                }

                if (newTabExists == false)
                {
                    // Create a new tab page using the connection profile (a TeamConnection class object) as input.
                    CustomTabPageConnection localCustomTabPage = new CustomTabPageConnection(connectionProfile);
                    localCustomTabPage.OnDeleteConnection += DeleteConnection;
                    localCustomTabPage.OnChangeMainText   += UpdateMainInformationTextBox;
                    localCustomTabPage.OnSaveConnection   += SaveConnection;
                    tabControlConnections.TabPages.Insert(lastIndex, localCustomTabPage);
                    tabControlConnections.SelectedIndex = lastIndex;

                    GlobalParameters.TeamEventLog.Add(Event.CreateNewEvent(EventTypes.Information, $"A new connection was created."));
                }
                else
                {
                    richTextBoxInformation.AppendText("There is already a 'new connection' tab open. Please close or save this first.\r\n");
                }
            }
        }