Selecting all text/chars in TextCtrl

Hmm - perhaps I meant a different function? I have implemented this,
and it works, but it doesn't do the same as I was thinking. I would
like the text to be selected just the same as if I had pressed
Control-A. When I press control-A the text turns blue (according to
the theme on my GTK-based desktop). However, when I select the text
using SetSelection(-1,-1) the text is highlighted in a gray and then
if I type the text isn't replaced, and if I press Control-C, the text
isn't copied. In Windows, the SetSelection function doesn't seem to
have any effect at all.

Basically, I just want the functionality to do the same as pressing control-A.
TIA.
Adam

···

On 1/7/07, Robin Dunn <robin@alldunn.com> wrote:

Adam Cripps wrote:
> Can anyone point me to a method which will select all the text?

SetSelection(-1,-1) will do it.

--

PGP key: 0x7111B833

Adam Cripps wrote:

> Adam Cripps wrote:
> > Can anyone point me to a method which will select all the text?
>
> SetSelection(-1,-1) will do it.

Hmm - perhaps I meant a different function? I have
implemented this, and it works, but it doesn't do the same as
I was thinking. I would like the text to be selected just the
same as if I had pressed Control-A. When I press control-A
the text turns blue (according to the theme on my GTK-based
desktop). However, when I select the text using
SetSelection(-1,-1) the text is highlighted in a gray and
then if I type the text isn't replaced, and if I press
Control-C, the text isn't copied. In Windows, the
SetSelection function doesn't seem to have any effect at all.

Basically, I just want the functionality to do the same as
pressing control-A.

I'm guessing here, but I think that SetSelection worked, but the control
does not have focus.

Try calling SetFocus() on the control, and see if that makes a difference.

HTH

Frank Millman

···

On 1/7/07, Robin Dunn <robin@alldunn.com> wrote:

Works perfectly! Thanks.

Adam

···

On 1/8/07, Frank Millman <frank@chagford.com> wrote:

Adam Cripps wrote:

I'm guessing here, but I think that SetSelection worked, but the control
does not have focus.

Try calling SetFocus() on the control, and see if that makes a difference.

--

PGP key: 0x7111B833