This is a migrated thread and some comments may be shown as answers.

TitleBar DoubleClick firing other control events

1 Answer 72 Views
TitleBar
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 15 Dec 2010, 12:34 PM
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.

1 Answer, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 15 Dec 2010, 01:19 PM
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
Tags
TitleBar
Asked by
Matt
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Share this question
or