|
-
Nov 19th, 2002, 12:26 AM
#1
Thread Starter
Fanatic Member
Is this possible...Can somebody resolve(** Resolved**)
I have two text boxes on a form and I'm typing in one of them.. Iwant to send the same or different character to the other text box on every key press in the first text box basing on some conditions... How can I do this? I need to send a value to the other text box for every key press in the first one. I dont want to use OtherTxtbox.text=OtherTxtbox.text & "something"...please guide me... thank you
Last edited by sridharavijay; Nov 19th, 2002 at 05:19 AM.
-
Nov 19th, 2002, 12:36 AM
#2
Hyperactive Member
Not sure if this is what you want but here
VB Code:
Option Explicit
Private Sub Text1_Change()
If Not IsNumeric(Right$(Text1.Text, 1)) Then
Text2.Text = Right$(Text1.Text, 1)
End If
End Sub
We don't know what's wrong. . . So the best bet might be to remove something surgically.
-
Nov 19th, 2002, 12:42 AM
#3
Thread Starter
Fanatic Member
not exactly... but i want the previous text also to stay there...if i use
text2.text=text2.text & "something" and if the length is toomuch , there is a blinking of text for every keydown and it is very annoying...
-
Nov 19th, 2002, 12:55 AM
#4
Hyperactive Member
okay, i don't get the blinking, but my computer is really fast.
Do you have to display the contents of the second text box "live"? Because you could store it in a String and put it into the text box when you are finished.
We don't know what's wrong. . . So the best bet might be to remove something surgically.
-
Nov 19th, 2002, 01:16 AM
#5
Thread Starter
Fanatic Member
yes buddy I need it live...every key has been mapped to another character and the key stroke should be visible in the other box also....
-
Nov 19th, 2002, 01:25 AM
#6
Hyperactive Member
Looks to me like you are going to have to put up with the blinking. Because if you want to store all the keys in the one text box live this is pretty much the only way.
We don't know what's wrong. . . So the best bet might be to remove something surgically.
-
Nov 19th, 2002, 03:23 AM
#7
Thread Starter
Fanatic Member
Nobody could solve my problem!!!!
-
Nov 19th, 2002, 03:30 AM
#8
VB Code:
Option Explicit
Private Sub Text1_Change()
If Not IsNumeric(Right$(Text1.Text, 1)) Then
Text2.Text = Text2.Text & Right$(Text1.Text, 1)
End If
End Sub
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Nov 19th, 2002, 03:30 AM
#9
Frenzied Member
Haven't got the blinking either.
Code:
If Question = Incomplete Then
AnswerNextOne
Else
ReplyIfKnown
End If
cu Swatty
-
Nov 19th, 2002, 03:35 AM
#10
Thread Starter
Fanatic Member
When the text is too large to handle and when you also put code to keys like delete and backspace, this blinks in my machine...,my machine is P2-500MHz...and the application i'm working for will finaly run on normal pentiums as of now...
If you write few sentences this may not look blinking but just if it goes beyond 40-50 k then it is quite annoying...
What is need is just to invoke a key press event in the other text box...it is straight forward but too difficult to make it for me atleast
-
Nov 19th, 2002, 04:24 AM
#11
VB Code:
Option Explicit
Private Sub Text1_Change()
Dim strTemp As String
If Not IsNumeric(Right$(Text1.Text, 1)) Then
strTemp = Text2.Text & Right$(Text1.Text, 1)
If Len(strTemp) <= Text2.MaxLength Then
Text2.Textc = strTemp
End If
End If
End Sub
Would this do?
Woka
-
Nov 19th, 2002, 04:54 AM
#12
New Member
Private Sub Text1_Change()
Dim s As String
s = ""
Text2.Text = s + Text1.Text
End Sub
ghjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjj
-
Nov 19th, 2002, 04:56 AM
#13
Errrr...that last post makes no sense. You are just making Text2.text = Text1.text 
Woka
-
Nov 19th, 2002, 05:04 AM
#14
So Unbanned
Well there are a few ways this could be done.
I'd suggest using the KeyPress event.
Now, in that event you can do several things.
You could set up an array, or string, and get a character for each ascii, or do any number of select case/if structures.
VB Code:
'in keypress
text2.selstart = len(text2.text)
If KeyAscii > 31 Then Text2.SelText = Chr$(KeyAscii)
-
Nov 19th, 2002, 05:09 AM
#15
Thread Starter
Fanatic Member
Thank you one and all... esp Blink and Woka and Swatty..
but ain't there anuthing that, without touching the earlier txt, just adds a new character......I just want to make it as if I'm typing into that text box,
If nothing of that sort is there...then it is a drawback....Why I'm sticking to my words is that when I made a syntax highlighter, when the file size grew, the processing was nagging....If the user has high speed of typing, the syntax checking took not lessthan a second to process and put it to screen for each key stroke when the file grew.
Well thats my story about "Text2.text=Text2.text & text1.text"...
If any alternative is there, pls provide... Any ways Many Many thanks to all
-
Nov 19th, 2002, 05:14 AM
#16
Thread Starter
Fanatic Member
Wow! great digital !! it really solves my problem to a max extent.....!!!
Thanks you soo much
Let me know if I could something more!!!(though not necessary)
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|