Results 1 to 13 of 13

Thread: Writing backwards. [NOT RESOLVED]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Exclamation Writing backwards. [NOT RESOLVED]

    Will it be difficult to implement a solution to forcing text to be written from the right side of the textbox to the left? So when I type a character, the IBeam appears on the left side of the typed letter instead of the right.
    Last edited by martw; May 16th, 2005 at 12:37 AM. Reason: not resolved
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Writing backwards.

    Set the RightToLeft property of the textbox to Yes and its automatically taken care of.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Re: Writing backwards.

    is that what it does... thanks RD
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Writing backwards.

    Yup, in VB6 it was dependent upon your version of Windows for it to be enabled. Although now its independent of the OS.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Re: Writing backwards. [RESOLVED]

    Cool. Usually if a property has no visible effect I tend to ignore it :P
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Writing backwards. [RESOLVED]

    There are allot of properties that have no design time effect. If you want to know what a property does you should check the
    MSDN help file or MSDN On-Line. Your missing out if you dont.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Re: Writing backwards. [RESOLVED]

    Wait, its not resolved All that happened, was that it invert the effect of the TextAlight property. So if TextAlign is set to Right, then it makes it Left but the next char will still appear on the right side of the previous char.
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Writing backwards. [NOT RESOLVED]

    You'd have to use an RTL font such as Arabic or Hebrew to get that effect.

    The other thing you could do is to capture each key being entered and place it yourself at the other 'end' of the string.

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Writing backwards. [NOT RESOLVED]

    But the RTL property works correctly, but doesnt reverse the fonts.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Re: Writing backwards. [NOT RESOLVED]

    VB Code:
    1. If e.KeyChar.IsDigit(e.KeyChar.ToString) = False And e.KeyChar.IsControl(e.KeyChar.ToString) = False Then
    2.       e.Handled = True
    3.       ' Here I can put the SendKey to send the pressing of the
    4.       ' Left Arrow to windows so that it jumps onto the right side.
    5. End If
    The only problem I have with this that this event also manages the pressing of backspace. So if I press backspace, it will jump one character back, thus making backspace useless and a big hassle for the user. This code is in my textbox's KeyPress event.
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Re: Writing backwards. [NOT RESOLVED]

    I would still like to resolve this. I can modify the code but can sopmeone please tell me how i call the left direction key? If i can get that, then hopefully i can resolve this.
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

  12. #12
    Fanatic Member
    Join Date
    May 2005
    Posts
    898

    Re: Writing backwards. [NOT RESOLVED]

    Just thinking out loud here but you could set the cursor position with textbox.SelectedText = x and TextBox.SelectionLength = 0
    "so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman

  13. #13
    Fanatic Member
    Join Date
    May 2005
    Posts
    898

    Re: Writing backwards. [NOT RESOLVED]

    Her's my two cents:
    VB Code:
    1. Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    2.         e.Handled = True
    3.         Select Case e.KeyChar
    4.             Case ControlChars.Back
    5.                 If TextBox1.SelectionLength = 0 Then
    6.                     TextBox1.SelectionLength = 1
    7.                 End If
    8.                 TextBox1.SelectedText = ""
    9.                 TextBox1.SelectionStart += 1
    10.  
    11.             Case Else
    12.                 TextBox1.SelectedText = e.KeyChar
    13.                 If TextBox1.SelectionStart > 0 Then TextBox1.SelectionStart -= 1
    14.         End Select
    15.     End Sub

    This doesn't deal with the Del-key or with any of the Controls like Crtl-Z 'N stuff. But it's something.
    Last edited by grilkip; May 16th, 2005 at 11:14 AM.
    "so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman

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