TitleBar DoubleClick firing other control events

2 posts, 1 answers
  1. Matt
    Matt avatar
    10 posts
    Member since:
    Jun 2008

    Posted 15 Dec 2010 Link to this post

    Hi,

    I have a RadForm, which contains a number of controls, including a number of RadTextBoxes with enter and leave events. When the enter event is fired the background of the selected RadTextBox is coloured yellow, and when the leave event is fired the background returns to white, to highlight which RadTextBox is currently selected.

    This is working fine; however, when the user double clicks the title bar of the RadForm the RadTextBox leave event is always being fired. This doesn't get fired when the RadForm is maximised by using the maximise box, or by clicking on the icon in the title bar, and clicking maximise.

    Why does double clicking the title bar fire the RadTextBox leave event, when maximising the RadForm in any other way doesn't? Ideally I would like to continue to allow the user to maximise the form by double clicking the title bar, but, if this isn't possible, then I guess I will have to disable this. Is this possible?

    Thanks in advance,
    Matt.
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 15 Dec 2010 Link to this post

    Hi Matt,

    I haven't been able to replicate this. I have added 2 RadtextBoxes to a RadForm and added the following code
    Private Sub RadTextBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadTextBox1.Enter
        Me.RadTextBox1.TextBoxElement.BackColor = Color.Yellow
    End Sub
    Private Sub RadTextBox1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadTextBox1.Leave
        Me.RadTextBox1.TextBoxElement.BackColor = Color.White
    End Sub
    Private Sub RadTextBox2_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadTextBox2.Enter
        Me.RadTextBox2.TextBoxElement.BackColor = Color.Yellow
    End Sub
    Private Sub RadTextBox2_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadTextBox2.Leave
        Me.RadTextBox2.TextBoxElement.BackColor = Color.White
    End Sub

    When I double click on the title bar, the form maximizes and the box back colour stays yellow.
    If you are using an older version of the controls I'd suggest upgrading to the newest version.

    Hope that helps
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top