| | |
c# escape characters cause [] in listview
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jan 2008
Posts: 2,052
Reputation:
Solved Threads: 123
the following escape sequences cause [] in listview. Is there any way to fix it?
Form1.cs :
Form1.Designer.cs :
Project is attached.
Form1.cs :
C# Syntax (Toggle Plain Text)
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace newLineInListView { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); sb.Append("\r"); sb.Append("1"); sb.Append("\n"); sb.Append("2"); sb.Append("\a"); sb.Append("3"); sb.Append("\b"); sb.Append("4"); sb.Append("\f"); sb.Append("5"); sb.Append("\t"); sb.Append("6"); sb.Append("\v"); sb.Append("7"); ListViewItem lvi = new ListViewItem(sb.ToString()); listView1.Items.Add(lvi); } } }
Form1.Designer.cs :
C# Syntax (Toggle Plain Text)
namespace newLineInListView { partial class Form1 { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.listView1 = new System.Windows.Forms.ListView(); this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); this.SuspendLayout(); // // listView1 // this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1}); this.listView1.Location = new System.Drawing.Point(71, 25); this.listView1.Name = "listView1"; this.listView1.Size = new System.Drawing.Size(250, 145); this.listView1.TabIndex = 0; this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.View = System.Windows.Forms.View.Details; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(409, 289); this.Controls.Add(this.listView1); this.Name = "Form1"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); this.ResumeLayout(false); } #endregion private System.Windows.Forms.ListView listView1; private System.Windows.Forms.ColumnHeader columnHeader1; } }
Project is attached.
Due to lack of freedom of speech, i no longer post on this website.
Getting te same.
But why does someone wants to display \a in a ListVIEW?
\a is the alert or bell character, I believe it is ASCII 7 so it is below ASCII 32(the space) and is as such non printable. Same as opening excel.exe in Word. Looks like rubbish because of the non printables.
But why does someone wants to display \a in a ListVIEW?
\a is the alert or bell character, I believe it is ASCII 7 so it is below ASCII 32(the space) and is as such non printable. Same as opening excel.exe in Word. Looks like rubbish because of the non printables.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
•
•
Join Date: May 2009
Posts: 114
Reputation:
Solved Threads: 11
Since the listview doesn't accept some of the linefeed commands, etc.., it shows the command as a special character. I'm guessing some of the characters differ in ALT codes between XP and Vista. Thus, the special character being displayed in Vista (or win7 in my case) would be read and displayed as a "[, ]" in XP.
•
•
Join Date: Jan 2008
Posts: 2,052
Reputation:
Solved Threads: 123
they are some seperators showing some hierarchical relation between strings. i can not remove them. but anyway i think this is a known issue, i am not alone and i am going to mark this thread as solved by contributing to y'all's solved threads.
Due to lack of freedom of speech, i no longer post on this website.
![]() |
Similar Threads
- Adding in escape characters into a string (C#)
- Using Hidden Characters (C++)
- How to print to file (Perl)
- regular expressions (Java)
- nested joins, from mdb. Possible? (Visual Basic 4 / 5 / 6)
- Using Global Low-Level Hooks Without Using A Dll (Computer Science)
- replacing unprintable characters (C)
- Uri (Java)
- Html (Java)
Other Threads in the C# Forum
- Previous Thread: C# tool help
- Next Thread: Retrieving records in batches of 50
Views: 1036 | Replies: 18
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast button buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development drawing encryption enum event excel file files form format ftp function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view webbrowser windows winforms wpf xml






