Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to change 1

Status
Not open for further replies.

KoenPiller

Programmer
Apr 4, 2001
270
NL
Hi,
I would like to change the KeyPress value, e.g. when you press the "8" it will result as if you would have pressed the "*".
Can't use the syntax:
Code:
ThisForm.myField.Value = STRTRAN(ThisForm.myField.Value, "8","*")
since this will move the cursor to the start of the textbox, which is unwanted.
Any suggestion how to solve this, without messing the endusers Keyboardlayout?
Thanks.
Koen
 
Set * in the PasswordChar Property of the textbox or whatever.

Regards,

Mike
 
Mike,

That's ok, but unfortunately I shall also want to change the "/" into a "?" and moreover all the others should remain as default.

Koen
 
Jim,

So sorry. KEYBOARD '{END}' indeed move the cursor to the end, the conversion works fine untill the programm moves to the next event. e.g. "aa/" will change into "aa?" - the variable and the ThisForm.cWord.Value but in Interactive Event I see them both as "/aa?".
There should be a way to switch the Keyboardvalue from default to my settings and back but how??

Koen
Code:
*KeyPress Event
LOCAL lcWord
With Thisform
	lcWord = Allt(.cWord.Value)			
	Do Case
		Case nKeyCode = 47 &&/
			lcWord=Alltrim(lcWord)+"?"  
			Keyboard '{END}'
			.cWord.Value=lcWord
		Case nKeyCode = 13   &&Enter
			.StartZoek()     &&Starts a SQL Select()
	Endcase
Endwith
*InterActiveChange Event    
Local lcWord

in the
 
Koen,

See if this works.

In a textbox KeyPress:
Code:
LPARAMETERS nKeyCode, nShiftAltCtrl
LOCAL lcWord
lcWord = Alltrim(this.Value) 
Do Case
    Case nKeyCode = 47 &&/
        lcWord = lcWord + "?"  
*        Keyboard '{END}'
        this.Value=lcWord
        this.SelStart = LEN(lcWord)
        NODEFAULT 
    Case nKeyCode = 13   &&Enter
       * .StartZoek()     &&Starts a SQL Select()
Endcase

Regards,

Mike
 
Mike,

Is it allowed to mail a person 2Stars?

Thanks!

Koen
 
Koen,

Is it allowed to mail a person 2Stars?

Likely not. Glad you got it working.

Regards,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top