I am still trying to understand WPF coming from WInForms. In Forms there was a property to select the text (or number) when the control got focus. Is there a way to do this with the WPF Editors in VB.NET, or XAML?
Hello,
I can’t think of a property you can use right away. What you can do is handle the EditModeStarting or the EditModeStarted event and use the SelectAll method like so:
private void xamTextEditor1_EditModeStarting(object sender, Infragistics.Windows.Editors.Events.EditModeStartingEventArgs e)
{
xamTextEditor1.SelectAll();
}
Let me know if this helps and if you require any further assistance.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
Has there been any change to this? Is there now a property to support this? Is there a way in XAML to reproduce the SelectAll, if no prop exists?
Thx
Even though there is still no such property available, I have again addressed this issue, trying to think of a custom approach to set this using only xaml. I wasn’t able to come up with anything useful and at this point, if this requirement is a must be, I can suggest creating a new controls that would inherit our XamTextEditor, where you can easily implement the functionality in the new class’s body.
If you require any further assistance on this issue I can suggest you start a new thread and reference this one in the description.
There is a way to do this using SelectionStart=0 and SelectionLength=100(for example) properties in XAML. But this will work only at first time when xamTextEditor receives the focus.
Anastas