We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Extra character (not visible) added to the retrieved text

Thread ID:

Created:

Updated:

Platform:

Replies:

41752 Mar 10,2006 04:40 AM Mar 14,2006 02:33 AM Windows Forms 3
loading
Tags: EditControl
Baylaucq
Asked On March 10, 2006 04:40 AM

Good morning, I''m currently testing the "edit component" for my company and I''ve got an issue with it. 1°) I set the edit control text to a specific string StartText = "toto" EditControl1.Text = StartText 2°) I retrieve the text from the edit control without modifying it at all. EndText = EditControl1.Text 3°) If I''m looking at the ascci codes of StartText and EndText, there are not the same! One ascii code is added to the end of EndText! StartText ASCII codes ("toto"): 116-111-116-111- EndText ASCII codes: 116-111-116-111-111- Could you please help me? You can find the source code (VB.NET) I used to test this issue. Just copy/paste it in a form and add an editcontrol and a button to it. Private StartText As String Private EndText As String Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load StartText = "toto" EditControl1.Text = StartText End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim i As Long Dim TextToDisplay1 As String Dim TextToDisplay2 As String EndText = EditControl1.Text For i = 1 To Len(StartText) TextToDisplay1 = TextToDisplay1 & Asc(Mid(StartText, i, 1)) & "-" Next For i = 1 To Len(EndText) TextToDisplay2 = TextToDisplay1 & Asc(Mid(EndText, i, 1)) & "-" Next MsgBox(TextToDisplay1 & vbCrLf & TextToDisplay2) End Sub

Administrator [Syncfusion]
Replied On March 13, 2006 06:07 AM

Hi Jerome, Please modify the second ''for'' loop For i = 1 To Len(EndText) TextToDisplay2 = TextToDisplay1 & Asc(Mid(EndText, i, 1)) & "-" Next as given below For i = 1 To Len(EndText) TextToDisplay2 = TextToDisplay2 & Asc(Mid(EndText, i, 1)) & "-" Next TextToDisplay2 should be used instead of TextToDisplay1 in the ''for'' loop .The ascii codes of StartText and EndText, are the same.I have attached a sample that illustrates this.Let me know if you have any questions. Regards, Ebenezer.P

ASCII.zip

Baylaucq
Replied On March 13, 2006 10:25 AM

Shame on me!!! Sorry for this mistake. However, I''ve got another issue: I''m setting the StartText: StartText = "toto" & vbCrLf & "titi" Then, I''m giving this StartText to a textbox and an editcontrol. TextBox1.Text = StartText EditControl1.Text = StartText Those 2 controls are displaying correctly the StartText. But then, if I''m giving the editcontrol text to the textbox, the textbox is not displaying the text correctly: EndText = EditControl1.Text TextBox1.Text = EndText Indeed, vbCrLf (ascii codes 13 and 10) is replaced by the editcontrol by the unique ascii code 10. Is there a way to configure the editcontrol so that the newline code is not modified by the editcontrol? always ascci codes 13 and 10. I''ve tried to play with the DefaultNewLineStyle property without any success. Just copy/paste the code below (I promiss it is correct ;-) ) to a form with a textbox, an editcontrol and a button. --------------------------------------------- Private StartText As String Private EndText As String Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load StartText = "toto" & vbCrLf & "titi" TextBox1.Text = StartText EditControl1.Text = StartText End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim i As Long Dim TextToDisplay1 As String Dim TextToDisplay2 As String EndText = EditControl1.Text TextBox1.Text = EndText For i = 1 To Len(StartText) TextToDisplay1 = TextToDisplay1 & Asc(Mid(StartText, i, 1)) & "-" Next For i = 1 To Len(EndText) TextToDisplay2 = TextToDisplay2 & Asc(Mid(EndText, i, 1)) & "-" Next MsgBox(TextToDisplay1 & vbCrLf & TextToDisplay2) ------------------------------------------ Regards, Jerome

Administrator [Syncfusion]
Replied On March 14, 2006 02:33 AM

Hi Jerome, Thanks for bringing this issue to our attention. I do see this problem here and have notified the development team in this regard. We have logged a bug report Defect# 1678 on this, and will try our very best to address the same at the earliest. You could track the progress of this bug fix at this link below : Defect #1678 - Ascii codes 13 and 10 replaced by EditControl. Thanks for your patience. Regards, Ebenezer.P

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;