• 0

How to recognize Chr(13) in textbox ?


Question

  • 0
  Elagizy said:
hi

when i run this code "enter" is recognized ...

If InStr(Text1.Text, Chr(13), CompareMethod.Binary) Then

but this code,  "enter" is not recognized ... WHY ?

If Text1.Text = Chr(13) Then

i need to know how to recognize if Text1.text = chr(13) only or not ?

thanks for any help

585659076[/snapback]

Check the length of the string?

11 answers to this question

Recommended Posts

  • 0
  gameguy said:
For Windows machines, you need to use both characters 13 (carriage return) and 10 (new line).

In fact, it's better off not to use the individual characters at all. Instead, use Environment.NewLine (Y)

585659270[/snapback]

can you tell me the code, pleaaaaaase ?

  • 0
  Elagizy said:
i did it anyway :p, besides i can't understand what do you mean .

585659575[/snapback]

He's talking about using the .NET method System.Environment.NewLine.

It returns the new line based on the current environment, there's no difference right now, but future wise when the framework is ported to another OS, the new line will differe across platforms, it's just better to conform this way earlier, so that your applications would have the possibility of being compatible with other OS's providing that a framework is created for another OS withing the future.

  • 0
  Winston said:
He's talking about using the .NET method System.Environment.NewLine.

It returns the new line based on the current environment, there's no difference right now, but future wise when the framework is ported to another OS, the new line will differe across platforms, it's just better to conform this way earlier, so that your applications would have the possibility of being compatible with other OS's providing that a framework is created for another OS withing the future.

585659936[/snapback]

hmm, ok can you please give me the code which recognize if text1.text = chr(13) using System.Environment.NewLine cause i can't do it

  • 0
  Elagizy said:
hmm, ok can you please give me the code which recognize if text1.text = chr(13) using System.Environment.NewLine cause i can't do it

585659997[/snapback]

Actually an easier way would be using this

    Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
        If e.KeyCode.Enter Then
            MessageBox.Show("Ita carriage return")
        End If
    End Sub

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I want to like ^^ this ^^ twice 😛
    • No, it doesn't, but I'm sure you don't just mean compile when you say compile.
    • Wine is a translation layer, not an emulator. And there are many cases where performance is worse or BETTER under Proton, it really depends on the game in question.
    • ImgDrive 2.2.3 by Razvan Serea ImgDrive is a CD/DVD/BD emulator - a tool that allows you to mount optical disc images by simply clicking on them in Windows Explorer. If you have downloaded an ISO image and want to use it without burning it to a blank disc, ImgDrive is the easiest way to do it. ImgDrive features: One-click mounting of iso, cue, nrg, mds/mdf, ccd, isz images Runs on 32-bit and 64-bit Windows versions Mount ape, flac, m4a, wav, wavpack, tta file as AUDIO CD (16-bit/44.1kHz) Mount a folder as DVD/BD Mount images in command line Does not require rebooting after installation Support up to 7 virtual drives at the same time Support multi session disc image (ccd/mds/nrg) A special portable version is available Translated to more than 10 languages ImgDrive is freeware, you may use it at no cost Support File Type: .ccd - CloneCD image files .cue - Cue sheets files of ape/flac/m4a/tta/wav/wv/bin .iso - Standard ISO image files .isz - Compressed ISO image files .nrg - Nero image files .mds - Media descriptor image files ImgDrive 2.2.3 changelog: Some minor changes and improvements Download: ImgDrive 2.2.3 | 701 KB (Freeware, paid upgrade available) Download: ImgDrive Portable 547 KB View: ImgDrive Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • One Month Later
      VAT Services in UAE earned a badge
      One Month Later
    • First Post
      LsDmT earned a badge
      First Post
    • One Month Later
      evershinefacilityservice earned a badge
      One Month Later
    • Week One Done
      evershinefacilityservice earned a badge
      Week One Done
    • One Month Later
      POR2GAL4EVER earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      571
    2. 2
      ATLien_0
      253
    3. 3
      +Edouard
      162
    4. 4
      +FloatingFatMan
      151
    5. 5
      Michael Scrip
      110
  • Tell a friend

    Love Neowin? Tell a friend!