Page 1 of 1

Move programically the cursor to the end in the textbox?

Posted: Thu Jun 10, 2010 5:01 pm
by Czarny_Pijar
How to move programically the cursor to the end in the textbox?
Borrowed from the Clipper

Code: Select all

Keyboard Chr(K_END)
seems to be useless.
The demo is attached below.

Re: Move programically the cursor to the end in the textbox?

Posted: Thu Jun 10, 2010 5:30 pm
by Roberto Lopez
Czarny_Pijar wrote:How to move programically the cursor to the end in the textbox?
Borrowed from the Clipper

Code: Select all

Keyboard Chr(K_END)
seems to be useless.

The demo is attached below.
Keyboard is a console mode command. It does not work in GUI mode.

The same thing can be achieved in HMG using 'caretpos' property.

ie:

Win1.Text1.CaretPos := Len(Win1.Text1.Value)

Re: Move programically the cursor to the end in the textbox?

Posted: Thu Jun 10, 2010 5:30 pm
by esgici
Czarny_Pijar wrote:How to move programically the cursor to the end in the textbox?
Borrowed from the Clipper

Code: Select all

Keyboard Chr(K_END)
seems to be useless.
The demo is attached below.
Hi Czarny

You are right, not only Keyboard command, INKEY() and LASTKEY() functions too, not only useless, meaningless too in GUI mode.

Simply add

Code: Select all

  Main.Text_1.CaretPos := LEN( Main.Text_1.Value )
to the proc p_txt_chg()

Regards

--

Esgici

Re: Move programically the cursor to the end in the textbox?

Posted: Thu Jun 10, 2010 9:32 pm
by Czarny_Pijar
Tank you all, this works, but... We come back to the auto-trim inside the textbox problem discussed earlier here. Because of this, the new problem emerged:

How to programically add the space sign to the end of the string inside the textbox?

I suspect this is not possible, but... Let ours gurus confirm this. :)

Re: Move programically the cursor to the end in the textbox?

Posted: Fri Jun 11, 2010 7:20 am
by PeteWG
Czarny_Pijar wrote:Tank you all, this works, but... We come back to the auto-trim inside the textbox problem discussed earlier here. Because of this, the new problem emerged:

How to programically add the space sign to the end of the string inside the textbox?

I suspect this is not possible, but... Let ours gurus confirm this. :)
I have no time right now to comment in detail, but (unless i have misunderstood your question) you may find what you are looking for into attached code.

---
Pete

Re: Move programically the cursor to the end in the textbox?

Posted: Sun Jun 13, 2010 12:01 pm
by Czarny_Pijar
Thank you PeteWG for your code. I tried to use it, here's the stripped down version. Unfortunately it lost its functionality for no apparent (for me) reason. At this stage I see, only the predefined values of the strings can be SMART-ENDED :(

Re: Move programically the cursor to the end in the textbox?

Posted: Sun Jun 13, 2010 3:39 pm
by bootwan
:cry:

Re: Move programically the cursor to the end in the textbox?

Posted: Sun Jun 13, 2010 6:54 pm
by Czarny_Pijar
.
.
Yes, bootwan, that's exactly what I was looking for!
Works great, thank you very much :)

Re: Move programically the cursor to the end in the textbox?

Posted: Mon Jun 14, 2010 9:17 am
by PeteWG
Czarny_Pijar wrote:Thank you PeteWG for your code. I tried to use it, here's the stripped down version. Unfortunately it lost its functionality for no apparent (for me) reason. At this stage I see, only the predefined values of the strings can be SMART-ENDED :(
You're right! And this "losing functionality" is probably due to some serious "feature" (or should i say bug?)
I'm not sure if it is a miniGHI problem or another one "achievement" of the usual suspect (MS).
Googling a bit, discovered that we are not alone in this, since Ms-Acces users have been complained also, for the very same textbox trim behavior.
Sadly, we have to live with it, since, as we are being told by various microsoft MVPs, "It is normal...."



---
Pete