Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
Hi all,
 
i am currently experiencing some difficulties in getting arrow characters to display in a list view sub item. The code i am using is below:
 
lis = new ListViewItem(1.ToString());//(i + 1).ToString());
  if (targets[i].ApproachDirection.ToString().Equals("Forward"))
  {
      // up
      lis.SubItems.Add("↑");
  }
  else
  {
      // down = '↓';
      lis.SubItems.Add("↓");
  }
 

This looks fine but displays an unsupported char rectangle when displayed in the form.
 
Does anyone know how this can be resolved?
 
Thanks George
Posted 22-Feb-11 23:30pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

I just tried it - added a listview to a form, set the "View" to "List", and added this code:
listView1.Items.Add("↑");
listView1.Items.Add("U");
listView1.Items.Add("↓");
listView1.Items.Add("D");
It worked: what are you doing differently?
  Permalink  
Comments
SAKryukov at 23-Feb-11 14:50pm
   
Griff, missing part can by just font, see, I answered.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

These discussion should help you out:
Similar discussion 1[^]
Similar idea different scenario[^]
 
I guess, it's the font settings that make it look like a box. Trying setting the font via CSS to a valid family that shows an arrow.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

They will. You just need appropriate font. You can examine which font support what using standard application which comes with Windows installation: Character Map.
 
Make sure you use right Unicode characters; they are x2190 to x21EA, in the range called "Arrows".
 
—SA
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 23 Feb 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100