Completed
Last Updated: 23 Sep 2022 13:07 by ADMIN
Release R3 2022
Troy
Created on: 26 Aug 2022 06:38
Category: MessageBox
Type: Bug Report
1
RadMessageBox: default button is not focused when showing the message specifying a parent

If you use the following code snippet, once you click one of the buttons, immediately pressing the Spacebar will close the message as if the button was clicked:

        private void radButton1_Click(object sender, EventArgs e)
        {
            RadMessageBox.Show("Test", "Caption", MessageBoxButtons.OK);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Test", "Caption", MessageBoxButtons.OK);
        }

However, if you switch to the following approach, once you click one of the buttons, immediately pressing the Spacebar will close the standard MS MessageBox as if the button was clicked, but the RadMessageBox wouldn't be closed because the message doesn't have focus. 

        private void radButton1_Click(object sender, EventArgs e)
        {
            RadMessageBox.Show(this, "Test", "Deployment Result", MessageBoxButtons.OK, RadMessageIcon.Info); 
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show(this, "Test", "Deployment Result", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

No matter how the RadMessageBox is shown, it is expected to have focus to the message button by default.

Workaround:

            this.TopMost = true;
            RadMessageBox.Show(this, "Test", "Deployment Result", MessageBoxButtons.OK, RadMessageIcon.Info); 

0 comments