4 Answers, 1 is accepted
0
Hello Ricric,
You can achieve this by subscribing to the events of the hosted text box. I am posting you an example that demonstrates this:
I hope this is useful. Feel free to ask if you have any additional questions.
Best wishes,
Ivan Todorov
the Telerik team
You can achieve this by subscribing to the events of the hosted text box. I am posting you an example that demonstrates this:
public partial class CommandBarSample : Form{ private bool isEntering; public CommandBarSample() { InitializeComponent(); this.commandBarDropDownList1.DropDownListElement.TextBox.TextBoxItem.HostedControl.Enter += new EventHandler(CommandBarSample_Enter); this.commandBarDropDownList1.DropDownListElement.TextBox.TextBoxItem.HostedControl.MouseDown += new MouseEventHandler(HostedControl_MouseDown); } void HostedControl_MouseDown(object sender, MouseEventArgs e) { if (this.isEntering) { this.isEntering = false; (this.commandBarDropDownList1.DropDownListElement.TextBox.TextBoxItem.HostedControl as TextBox).SelectAll(); } } void CommandBarSample_Enter(object sender, EventArgs e) { this.isEntering = true; (this.commandBarDropDownList1.DropDownListElement.TextBox.TextBoxItem.HostedControl as TextBox).SelectAll(); }}I hope this is useful. Feel free to ask if you have any additional questions.
Best wishes,
Ivan Todorov
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
0
ricric
Top achievements
Rank 1
answered on 17 Jul 2011, 03:47 AM
could you translate the code in vb.net please?
thanks.
thanks.
0
Accepted
Hi Ricric,
Here is the same code, translated into VB:
In case you need to translate code snippets in the future, you can use our free Code Converter tool.
Hope this helps.
Kind regards,
Ivan Todorov
the Telerik team
Here is the same code, translated into VB:
Public Partial Class CommandBarSample Inherits Form Private isEntering As Boolean Public Sub New() InitializeComponent() AddHandler Me.commandBarDropDownList1.DropDownListElement.TextBox.TextBoxItem.HostedControl.Enter, AddressOf CommandBarSample_Enter AddHandler Me.commandBarDropDownList1.DropDownListElement.TextBox.TextBoxItem.HostedControl.MouseDown, AddressOf HostedControl_MouseDown End Sub Private Sub HostedControl_MouseDown(sender As Object, e As MouseEventArgs) If Me.isEntering Then Me.isEntering = False TryCast(Me.commandBarDropDownList1.DropDownListElement.TextBox.TextBoxItem.HostedControl, TextBox).SelectAll() End If End Sub Private Sub CommandBarSample_Enter(sender As Object, e As EventArgs) Me.isEntering = True TryCast(Me.commandBarDropDownList1.DropDownListElement.TextBox.TextBoxItem.HostedControl, TextBox).SelectAll() End SubEnd ClassIn case you need to translate code snippets in the future, you can use our free Code Converter tool.
Hope this helps.
Kind regards,
Ivan Todorov
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
0
ricric
Top achievements
Rank 1
answered on 21 Jul 2011, 11:16 AM
ok, thank you.