Re: How to insert a '*' in certain controls when Enter is pressed.
- From: ThomasAJ <ThomasAJ@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 4 Jan 2008 20:34:01 -0800
There could be many other NEW LINES either before or after the location of
where the NEW new line is called for. In other words the '*' must be inserted
AFTER where the NEW new line is created.
The end result is to look like:
* blah blah1
* blah blah2
* blah blah3
* blah blah4
--
Regards
Tom
"Minton M" wrote:
On Jan 4, 7:41 pm, ThomasAJ <Thoma...@xxxxxxxxxxxxxxxxxxxxxxxxx>.
wrote:
An important user wants to have a '*' inserted at the beginning of a NEW LINE
in certain controls when the ENTER key is pressed.
OK so in the Form_KeyDown event I can determine if the enter key has been
pressed, and I also know the name of the ActiveControl. The controls in
question have the NewLine property set to YES.
So how to insert a '*' at the beginning of the new line. I have tried some
silly code in the Form_KeyDown event but I think it is the wrong place to go
changing control text.
Also bear in mind that the ENTER key may have been pressed in the middle of
existing text and not just at the end.
--
Regards
Tom
In the control's keypress event, use Replace to search for the newline
character and replace with a * followed by a new line. Don't forget to
use the Text property of the Textbox rather than the value property.
-- James
- Follow-Ups:
- Re: How to insert a '*' in certain controls when Enter is pressed.
- From: Allen Browne
- Re: How to insert a '*' in certain controls when Enter is pressed.
- References:
- Prev by Date: Re: Problem with Data Types
- Next by Date: Re: How to insert a '*' in certain controls when Enter is pressed.
- Previous by thread: Re: How to insert a '*' in certain controls when Enter is pressed.
- Next by thread: Re: How to insert a '*' in certain controls when Enter is pressed.
- Index(es):
Relevant Pages
|