Print Page | Close Window

Select All Text when beginning Edit

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=2683
Printed Date: 19 September 2024 at 6:02pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Select All Text when beginning Edit
Posted By: Boyd
Subject: Select All Text when beginning Edit
Date Posted: 04 August 2005 at 11:55am

When the user starts to edit a value in ReportControl, I want to automatically select all the text because the user will typically be replacing the entire value.  Currently, it places the cursor at the first offset and has no selection.  This means the user has to then delete all the text before entering the new value.

Is there any way to specify that all text should be selected when beginning an edit operation?

Thanks in advance.




Replies:
Posted By: sserge
Date Posted: 27 June 2006 at 11:51am
Found your message today Embarrassed

The answer would be to set .SelectTextOnEdit of the corresponding item edit options to True (whether on populating the control, or just before starting editing). Example below:

With wndReportControl
    .FocusedRow.Record(COLUMN_SUBJECT).CreateEditOptions
    .FocusedRow.Record(COLUMN_SUBJECT).EditOptions.SelectTextOnEdit = True
    .EditItem .FocusedRow, .Columns.Find(COLUMN_SUBJECT)
End With


--
WBR,
Serge



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net