Skip to content

The content of the server message window cannot be cleared. Adding a double-click message window to clear console messages does not clear the content saved to the file. #1095

Description

@zhaokai1982
  1. The interface of the client login program is misaligned, and the interface has been fixed.

  2. The content of the server message window cannot be cleared. Adding a double-click message window to clear console messages does not clear the content saved to the file.
    Text logs are always retained.

  3. It is also necessary to add confirmation when the server program is closed, otherwise it is easy to mistakenly close the server and close the conversation without confirmation.

     // Double click on the log window to clear the content (with confirmation)
     private void LogTextBox_DoubleClick(object sender, EventArgs e)
     {
         if (MessageBox.Show("Are you sure you want to clear the log content?", "Confirm to clear", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             LogTextBox.Clear();
         }
     }
    
     //Double click in the debugging window to clear the content (with confirmation)
     private void DebugLogTextBox_DoubleClick(object sender, EventArgs e)
     {
         if (MessageBox.Show("Are you sure you want to clear the debugging content?", "Confirm to clear", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             DebugLogTextBox.Clear();
         }
     }
    
     //Double click in chat window to clear content (with confirmation)
     private void ChatLogTextBox_DoubleClick(object sender, EventArgs e)
     {
         if (MessageBox.Show("Are you sure you want to clear the chat content?", "Confirm to clear", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             ChatLogTextBox.Clear();
         }
     }
    
     private void MainMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
     {
    
     }
    

Activity

  1. zhaokai1982 commented on Jun 7, 2025

    @zhaokai1982
    Author
      Additional binding events need to be added in the upper part, as shown below.
    

    The above code and the following code are added to \Crystal\Server. MirForms\SMain. cs

            public SMain()
        {
            InitializeComponent();
    
            AutoResize();
            //Double click the event to clear the content
            LogTextBox.DoubleClick += LogTextBox_DoubleClick;
            DebugLogTextBox.DoubleClick += DebugLogTextBox_DoubleClick;
            ChatLogTextBox.DoubleClick += ChatLogTextBox_DoubleClick;
        }
    
  2. Suprcode commented on Jun 7, 2025

    @Suprcode
    Owner

    If you're wanting to contribute changes to the source please create pull requests. Pasted code in issues will not be added.

  3. zhaokai1982 commented on Jun 7, 2025

    @zhaokai1982
    Author

    I understand, but access to GIT is restricted in our country and region, and submissions always fail

  4. Suprcode commented on Jun 7, 2025

    @Suprcode
    Owner

    But you can access this website, and you have repos on your account so you should be able to fork this repo and make edits to create a pull request. Even if access is blocked through other means.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions