Xojo Conferences
MBSOct2019CologneDE

Editfield Problem (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Opening a document with a application?
Next thread: 4.5 MenuItem Bug?


Localized strings in tabpanel   -   Jan Erik Moström <
  Editfield Problem   -   Mia Nicole Whited
   Re: Editfield Problem   -   George Barnett
    Re: Editfield Problem   -   Joseph J. Strout
     Re: Editfield Problem   -   George Barnett

Editfield Problem
Date: 31.05.02 23:02 (Fri, 31 May 2002 18:02:40 -0400)
From: Mia Nicole Whited
Hi All,

I have a multiline editfield. When the user clicks anywhere
in the editfield I want all of the text to be selected so that
when a drag is done it takes all of the text. Is this possible?
If so, some help would be appreciated.

Thanks in advance,
Mia

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: Editfield Problem
Date: 01.06.02 04:11 (Fri, 31 May 2002 21:11:15 -0600)
From: George Barnett
Place the following code in the MouseDown event of your edit field:

Dim i as integer
Dim s as string
i = len(s)
me.selStart = 0
me.selLength = i+1
return true

A single mouse click will then select all of the text in the edit field.

George

On Friday, May 31, 2002, at 04:02 PM, Mia Nicole Whited wrote:

> Hi All,
>
> I have a multiline editfield. When the user clicks anywhere
> in the editfield I want all of the text to be selected so that
> when a drag is done it takes all of the text. Is this possible?
> If so, some help would be appreciated.
>
> Thanks in advance,
> Mia
>
> ---
> Subscribe to the digest:
> <mailto:<email address removed>>
> Unsubscribe:
> <mailto:<email address removed>>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: Editfield Problem
Date: 01.06.02 04:23 (Fri, 31 May 2002 20:23:07 -0700)
From: Joseph J. Strout
At 9:11 PM -0600 5/31/02, George Barnett wrote:
>Place the following code in the MouseDown event of your edit field:
>
>Dim i as integer
>Dim s as string
>i = len(s)
>me.selStart = 0
>me.selLength = i+1
>return true
>
>A single mouse click will then select all of the text in the edit field.

Hmm, s is "", so i is 0, so this should select just the first
character. How about this instead:

me.selStart = 0
me.selLength = LenB(me.text)
return true

Cheers,
- Joe

Re: Editfield Problem
Date: 01.06.02 16:22 (Sat, 01 Jun 2002 09:22:40 -0600)
From: George Barnett
Your code is more efficient. And I meant to insert:

s = me.text

Which does the same thing.

George

On Friday, May 31, 2002, at 09:23 PM, Joseph J. Strout wrote:

> At 9:11 PM -0600 5/31/02, George Barnett wrote:
>> Place the following code in the MouseDown event of your edit field:
>>
>> Dim i as integer
>> Dim s as string
>> i = len(s)
>> me.selStart = 0
>> me.selLength = i+1
>> return true
>>
>> A single mouse click will then select all of the text in the edit
>> field.
>
> Hmm, s is "", so i is 0, so this should select just the first
> character. How about this instead:
>
> me.selStart = 0
> me.selLength = LenB(me.text)
> return true
>
> Cheers,
> - Joe
>
> -- ,------------------------------------------------------------------.
> | Joseph J. Strout REAL Software, Inc. |
> | <email address removed> http://www.realsoftware.com |
> `------------------------------------------------------------------'
>
> ---
> Subscribe to the digest: <mailto:realbasic-nug-
> <email address removed>>
> Unsubscribe:
> <mailto:<email address removed>>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>