[c#] Consulta como seleccionar texto al tomar foco.

7 views
Skip to first unread message

Javier Osvaldo Chércoles

unread,
Feb 22, 2016, 1:37:47 PM2/22/16
to Dario Quintana
Estimados, esta es una consulta que me da un poco de vergüenza hacer pero no logro que funcione. Supuestamente para hacer que en un textbox cuando se ejecuta el evento Enter del control se seleccione el contenido debería escribir lo siguiente:

            txtQuantityPurchasedHours.SelectionStart = 0;
            txtQuantityPurchasedHours.SelectionLength = txtQuantityPurchasedHours.Text.Length;

Pero no no hace nada, es decir, no invierte el video del control, mucho menos para reemplazar el contenido tengo que borrar y volver a escribir.

Cordialmente por su ayuda.

Mil gracias.

Javier.
Reply all
Reply to author
Forward
0 new messages