Textbox

G

Guest

Guest
Archived from groups: microsoft.public.pocketpc (More info?)

Hi!
How can do, in a texbox: when gotfocus the text are been selected?

--


Cumprimentos,
David de Passos
--------------------------------------------------------------
RCSOFT, Lda.
E-Mail: passos@rcsoft.pt
Móvel: +351 966931639
Telefone: +351 239708708
Fax: +351 239708701
Tel. Directo: +351 239708705 ext. 401
 
G

Guest

Guest
Archived from groups: microsoft.public.pocketpc (More info?)

Hi David,

I did not understand your question completely. Which of the following do
want to do?

1. Get the selected text in the textbox, when it recieves the focus
Solution: You can get or set the selected text through the SelectedText
property.

2. Select the text when the textbox recieves the focus
Solution: Set the SelectionStart property to the beginning of the text
you want to select. [ textBox1.SelectionStart = 0; ]
Set the SelectionLength property to the length of the text
you want to select. [ textBox1.SelectionLength = textBox1.Text.Length; ]

For more info, look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconselectingtextprogrammatically.asp

Thanks,
Devi J V [MSFT]
--
This posting is provided "AS IS" with no warranties, and confers no rights.


"David de Passos" <passos@rcsoft.pt> wrote in message
news:OA5yemEGFHA.2736@TK2MSFTNGP09.phx.gbl...
> Hi!
> How can do, in a texbox: when gotfocus the text are been selected?
>
> --
>
>
> Cumprimentos,
> David de Passos
> --------------------------------------------------------------
> RCSOFT, Lda.
> E-Mail: passos@rcsoft.pt
> Móvel: +351 966931639
> Telefone: +351 239708708
> Fax: +351 239708701
> Tel. Directo: +351 239708705 ext. 401
>
 
G

Guest

Guest
Archived from groups: microsoft.public.pocketpc (More info?)

Thanks But textbox have SelectAll property :)

"Devi JV [MSFT]" <devijv@online.microsoft.com> wrote in message
news:%23ncBBMXGFHA.4088@TK2MSFTNGP09.phx.gbl...
> Hi David,
>
> I did not understand your question completely. Which of the following do
> want to do?
>
> 1. Get the selected text in the textbox, when it recieves the focus
> Solution: You can get or set the selected text through the
> SelectedText property.
>
> 2. Select the text when the textbox recieves the focus
> Solution: Set the SelectionStart property to the beginning of the text
> you want to select. [ textBox1.SelectionStart = 0; ]
> Set the SelectionLength property to the length of the
> text you want to select. [ textBox1.SelectionLength =
> textBox1.Text.Length; ]
>
> For more info, look at
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconselectingtextprogrammatically.asp
>
> Thanks,
> Devi J V [MSFT]
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
> "David de Passos" <passos@rcsoft.pt> wrote in message
> news:OA5yemEGFHA.2736@TK2MSFTNGP09.phx.gbl...
>> Hi!
>> How can do, in a texbox: when gotfocus the text are been selected?
>>
>> --
>>
>>
>> Cumprimentos,
>> David de Passos
>> --------------------------------------------------------------
>> RCSOFT, Lda.
>> E-Mail: passos@rcsoft.pt
>> Móvel: +351 966931639
>> Telefone: +351 239708708
>> Fax: +351 239708701
>> Tel. Directo: +351 239708705 ext. 401
>>
>
>
 

ASK THE COMMUNITY