Re: How to insert a '*' in certain controls when Enter is pressed.
- From: Minton M <jamesbeswick@xxxxxxxxx>
- Date: Fri, 4 Jan 2008 20:03:19 -0800 (PST)
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:
- Prev by Date: Re: How to determine name of control with focus in Form_KeyDown
- Next by Date: Re: Problem with Data Types
- Previous by thread: Re: How to determine name of control with focus in Form_KeyDown
- Next by thread: Re: How to insert a '*' in certain controls when Enter is pressed.
- Index(es):
Relevant Pages
|