Results 1 to 16 of 16

Thread: Is this possible...Can somebody resolve(** Resolved**)

  1. #1

    Thread Starter
    Fanatic Member sridharavijay's Avatar
    Join Date
    Sep 2002
    Location
    http://www.vijaysridhara.in
    Posts
    589

    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.

  2. #2
    Hyperactive Member Blinky Bill's Avatar
    Join Date
    Mar 2002
    Location
    Happily munching on the greenery in your garden
    Posts
    349
    Not sure if this is what you want but here
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Text1_Change()
    4.     If Not IsNumeric(Right$(Text1.Text, 1)) Then
    5.         Text2.Text = Right$(Text1.Text, 1)
    6.     End If
    7. End Sub
    We don't know what's wrong. . . So the best bet might be to remove something surgically.

  3. #3

    Thread Starter
    Fanatic Member sridharavijay's Avatar
    Join Date
    Sep 2002
    Location
    http://www.vijaysridhara.in
    Posts
    589
    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...

  4. #4
    Hyperactive Member Blinky Bill's Avatar
    Join Date
    Mar 2002
    Location
    Happily munching on the greenery in your garden
    Posts
    349
    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.

  5. #5

    Thread Starter
    Fanatic Member sridharavijay's Avatar
    Join Date
    Sep 2002
    Location
    http://www.vijaysridhara.in
    Posts
    589
    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....

  6. #6
    Hyperactive Member Blinky Bill's Avatar
    Join Date
    Mar 2002
    Location
    Happily munching on the greenery in your garden
    Posts
    349
    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.

  7. #7

    Thread Starter
    Fanatic Member sridharavijay's Avatar
    Join Date
    Sep 2002
    Location
    http://www.vijaysridhara.in
    Posts
    589

    Talking

    Nobody could solve my problem!!!!

  8. #8
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Text1_Change()
    4.     If Not IsNumeric(Right$(Text1.Text, 1)) Then
    5.         Text2.Text = Text2.Text & Right$(Text1.Text, 1)
    6.     End If
    7. 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

  9. #9
    Frenzied Member swatty's Avatar
    Join Date
    Aug 2002
    Location
    somewhere on earth
    Posts
    1,478
    Haven't got the blinking either.
    Code:
    If Question = Incomplete Then
       AnswerNextOne
    Else
       ReplyIfKnown
    End If
    cu Swatty

  10. #10

    Thread Starter
    Fanatic Member sridharavijay's Avatar
    Join Date
    Sep 2002
    Location
    http://www.vijaysridhara.in
    Posts
    589
    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

  11. #11
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Text1_Change()
    4. Dim strTemp   As String
    5.     If Not IsNumeric(Right$(Text1.Text, 1)) Then
    6.         strTemp = Text2.Text & Right$(Text1.Text, 1)
    7.         If Len(strTemp) <= Text2.MaxLength Then
    8.             Text2.Textc = strTemp
    9.         End If
    10.     End If
    11. End Sub
    Would this do?

    Woka

  12. #12
    New Member
    Join Date
    Nov 2002
    Posts
    7

    Unhappy

    Private Sub Text1_Change()
    Dim s As String
    s = ""
    Text2.Text = s + Text1.Text
    End Sub


    ghjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
    jjjjjjjjjjjjjjjj

  13. #13

  14. #14
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    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:
    1. 'in keypress
    2.  
    3. text2.selstart = len(text2.text)
    4. If KeyAscii > 31 Then Text2.SelText = Chr$(KeyAscii)

  15. #15

    Thread Starter
    Fanatic Member sridharavijay's Avatar
    Join Date
    Sep 2002
    Location
    http://www.vijaysridhara.in
    Posts
    589
    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

  16. #16

    Thread Starter
    Fanatic Member sridharavijay's Avatar
    Join Date
    Sep 2002
    Location
    http://www.vijaysridhara.in
    Posts
    589
    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
  •  



Click Here to Expand Forum to Full Width