473,379 Members | 1,170 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,379 software developers and data experts.

Indent text items in a ListBox

I want to represent a list of items as a heirarchy by,
indenting each item by a set amount depending on its level.
For example level 1 = no spaces, level 1 = 2 spaces etc.

If I try too use leading spaces or tabs to do this the
control removes them. Is there a way to do this?

Mike
Nov 20 '05 #1
4 3947
* "Mike Parris" <an*******@discussions.microsoft.com> scripsit:
I want to represent a list of items as a heirarchy by,
indenting each item by a set amount depending on its level.
For example level 1 = no spaces, level 1 = 2 spaces etc.

If I try too use leading spaces or tabs to do this the
control removes them. Is there a way to do this?


I am not able to repro that, spaces don't get removed on .NET 1.0,
Windows XP Professional.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Thanks for the reply,

Sorry, I should have included that I want the list to
appear in a Web project ListBox control. The listbox
control in Windows forms will do what I want.

Mike
-----Original Message-----
* "Mike Parris" <an*******@discussions.microsoft.com> scripsit:
I want to represent a list of items as a heirarchy by,
indenting each item by a set amount depending on its level. For example level 1 = no spaces, level 1 = 2 spaces etc.

If I try too use leading spaces or tabs to do this the
control removes them. Is there a way to do this?


I am not able to repro that, spaces don't get removed

on .NET 1.0,Windows XP Professional.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #3
* <an*******@discussions.microsoft.com> scripsit:
Sorry, I should have included that I want the list to
appear in a Web project ListBox control. The listbox
control in Windows forms will do what I want.


You may want to turn to the ng for ASP.NET Web Controls questions for future
ASP.NET Web Control related questions:

<news://msnews.microsoft.com/microsoft.public.dotnet.framework.aspnet.webcontro ls>

Web interface:

<http://msdn.microsoft.com/newsgroups/default.asp?url=/newsgroups/loadframes.asp?icp=msdn&slcid=us&newsgroup=microso ft.public.dotnet.framework.aspnet.webcontrols>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Thanks Herfried,
I will do that

Mike
-----Original Message-----
* <an*******@discussions.microsoft.com> scripsit:
Sorry, I should have included that I want the list to
appear in a Web project ListBox control. The listbox
control in Windows forms will do what I want.
You may want to turn to the ng for ASP.NET Web Controls

questions for futureASP.NET Web Control related questions:

<news://msnews.microsoft.com/microsof...c.dotnet.frame work.aspnet.webcontrols>
Web interface:

<http://msdn.microsoft.com/newsgroups/default.asp? url=/newsgroups/loadframes.asp?
icp=msdn&slcid=us&newsgroup=microsoft.public.dotne t.framewo
rk.aspnet.webcontrols>
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #5

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

Similar topics

8
by: pothik05 | last post by:
Hello I am trying to change the color of individual entry in the listbox control based on some custom event. Can anyone please give any idea how to do it? Thanks
2
by: David Ichilov | last post by:
I've class derived from "Object" class, with ToString() method overriden itc. , now i add object of this class to Windows.Forms.ListBox.Items collection, and it works fine, displaying what...
4
by: CrimeMaster | last post by:
HI I have an Exe file when it runs ,there are just two controls on the window.One is a ListBox and another is a Multi line Rich Edit control.When i click on an item in the list some text is...
1
by: cowznofsky | last post by:
I was databinding to a combobox and supplying both a DisplayMember and a ValueMember, so that each item. Now I've decided against databinding, and will populate it by going through a datatable....
2
by: Ron | last post by:
so if my textbox is named textbox1 and my listbox is named ltsdisplay, for the button that would make this all happen I would just need to: ...
6
by: rahulnag22 | last post by:
Hi, Is it possible to have different items in a listbox in different colors? Or is it just one color for all items in a listbox? Thanks Rahul
6
by: kimiraikkonen | last post by:
Hi, I want to save all the item content of a listbox line by line into a simple text file then recall them when my project is opened. For example listbox1 contains: That - item1 Group ...
6
by: kimiraikkonen | last post by:
Hi, I can read from a text file and insert text file's contents into a listbox whose format is line by line using this code: Dim reader As String reader = My.Computer.FileSystem.ReadAllText("c:...
1
by: PaulBrains | last post by:
I was trying to sum up all the items of a listbox in Visual Studio 2005. I tried to loop (from 0 to ListBox.Items.Count - 1) as follows For j as Integer = 0 to ListBox.Items.Count - 1 ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?

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.