コード例 #1
0
        //метод, распечатывающий имя бота синим цветом перед сообщением
        private void PrintRBot()
        {
            var startOfSelection = MessagesTextBox.TextLength;

            MessagesTextBox.AppendText("R-Bot: ");
            MessagesTextBox.Select(startOfSelection, "R-Bot:".Length);
            MessagesTextBox.SelectionColor = Color.Blue;
        }
コード例 #2
0
ファイル: ChatBotSunny.cs プロジェクト: MAARUUU/OOP
        //метод, распечатывающий имя бота синим цветом перед сообщением
        private void PrintRBot()
        {
            DateTime date             = DateTime.Now;
            string   outputSunny      = date.ToString("[dd/MM/yyyy HH:mm:ss] ") + "Лучик: ";
            var      startOfSelection = MessagesTextBox.TextLength;

            MessagesTextBox.AppendText(outputSunny);
            MessagesTextBox.Select(startOfSelection, outputSunny.Length);
            MessagesTextBox.SelectionColor = Color.Blue;
        }
コード例 #3
0
        //метод, отобращающий пользовательское сообщение
        private void ShowUserMessage()
        {
            var startOfSelection = MessagesTextBox.TextLength;

            MessagesTextBox.AppendText("Вы: ");
            MessagesTextBox.Select(startOfSelection, "Вы:".Length);
            MessagesTextBox.SelectionColor = Color.Green;

            MessagesTextBox.AppendText(QuestionTextBox.Text + "\r\n\r\n");
        }
コード例 #4
0
ファイル: MainWindow.cs プロジェクト: contributor51/openECA
 private void MessagesTextBox_SizeChanged(object sender, EventArgs e)
 {
     // Sometimes the scrollbar will fail to update or scroll
     // beyond the bottom of the text box when the text box
     // is resized. Scrolling to the top and then back to the
     // bottom fixes this problem
     MessagesTextBox.Select(0, 0);
     MessagesTextBox.ScrollToCaret();
     MessagesTextBox.Select(MessagesTextBox.TextLength, 0);
     MessagesTextBox.ScrollToCaret();
 }
コード例 #5
0
ファイル: ChatBotSunny.cs プロジェクト: MAARUUU/OOP
        //метод, отобращающий пользовательское сообщение
        private void ShowUserMessage()
        {
            DateTime date         = DateTime.Now;
            string   str          = Data.Text;
            string   outputPlayer = date.ToString("[dd/MM/yyyy HH:mm:ss] ") + str + ": ";

            var startOfSelection = MessagesTextBox.TextLength;

            MessagesTextBox.AppendText(outputPlayer);
            MessagesTextBox.Select(startOfSelection, outputPlayer.Length);
            MessagesTextBox.SelectionColor = Color.Green;
            MessagesTextBox.AppendText(QuestionTextBox.Text + "\r\n\r\n");
        }