473,408 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

List Box

Hi Guys,

I need to append space in front of Directory names inside listbox based on
the folder level inside directory.

If i do
lBoxLocation.Items.Add(new ListItem(" "+
dirInfo[i].Name,dirInfo(i).FullName))

it adds in front of value. If i put white space, it dont appear at all.

Can someone tell me or guide me to an example which shows how to work with
this?

Thanks

Manny

Nov 19 '05 #1
2 1103
Try running your string through an HtmlDecode:

dim spaces as string = DecodedSpaces(2)
lBoxLocation.Items.Add(spaces + dirInfo[i].Name,dirInfo(i).FullName)
public shared function DecodedSpaces(numberOfSpaces as integer) as string
dim spaces as string = ""
for i as integer = 0 to numberofSpaces - 1
spaces &= " "
next
return HttpUtility.HtmlDecode(spaces)
end function

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Manny Chohan" <Ma*********@discussions.microsoft.com> wrote in message
news:15**********************************@microsof t.com...
Hi Guys,

I need to append space in front of Directory names inside listbox based on
the folder level inside directory.

If i do
lBoxLocation.Items.Add(new ListItem(" "+
dirInfo[i].Name,dirInfo(i).FullName))

it adds in front of value. If i put white space, it dont appear at all.

Can someone tell me or guide me to an example which shows how to work with
this?

Thanks

Manny

Nov 19 '05 #2
"Manny Chohan" <Ma*********@discussions.microsoft.com> wrote in message news:15**********************************@microsof t.com...
I need to append space in front of Directory names inside listbox based on : : it adds in front of value. If i put white space, it dont appear at all.


Manny,

Whitespace will be normalized by the browser, so no matter how many consecutive
spaces you send they'll appear as only one on the user's screen.

What you need to do is prepend non-breaking spaces, &nbsp;, which the browser
won't force normalization of, e.g.,

lBoxLocation.Items.Add(new ListItem("&nbsp;&nbsp;&nbsp;&nbsp;" + _
dirInfo[i].Name,dirInfo(i).FullName))

Each &nbsp; will take up one space when seen in the browser by the user.
Derek Harmon
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: massimo | last post by:
Hey, I wrote this program which should take the numbers entered and sort them out. It doesnąt matter what order, if decreasing or increasing. I guess I'm confused in the sorting part. Anyone...
10
by: Kent | last post by:
Hi! I want to store data (of enemys in a game) as a linked list, each node will look something like the following: struct node { double x,y; // x and y position coordinates struct enemy...
24
by: Robin Cole | last post by:
I'd like a code review if anyone has the time. The code implements a basic skip list library for generic use. I use the following header for debug macros: /* public.h - Public declarations and...
4
by: JS | last post by:
I have a file called test.c. There I create a pointer to a pcb struct: struct pcb {   void *(*start_routine) (void *);   void *arg;   jmp_buf state;   int    stack; }; ...
3
by: chellappa | last post by:
hi this simple sorting , but it not running...please correect error for sorting using pointer or linked list sorting , i did value sorting in linkedlist please correct error #include<stdio.h>...
0
by: drewy2k12 | last post by:
Heres the story, I have to create a doubly linked list for class, and i have no clue on how to do it, i can barely create a single linked list. It has to have both a head and a tail pointer, and...
10
by: AZRebelCowgirl73 | last post by:
This is what I have so far: My program! import java.util.*; import java.lang.*; import java.io.*; import ch06.lists.*; public class UIandDB {
0
by: Atos | last post by:
SINGLE-LINKED LIST Let's start with the simplest kind of linked list : the single-linked list which only has one link per node. That node except from the data it contains, which might be...
12
by: kalyan | last post by:
Hi, I am using Linux + SysV Shared memory (sorry, but my question is all about offset + pointers and not about linux/IPC) and hence use offset's instead on pointers to store the linked list in...
7
by: QiongZ | last post by:
Hi, I just recently started studying C++ and basically copied an example in the textbook into VS2008, but it doesn't compile. I tried to modify the code by eliminating all the templates then it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.