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

C#NET2008 ListBox Set columnWidth

126 100+
Hullo Good Friends,
I need your help again, please help me.

I am using C#NET2008 for Window Application.

Being requested to use ListBox to display 2 columns of data, i.e. OrderNumber, OrderDate.

How to set the column widths to display OrderNumber and OrderDate

Please help me. Thanks.


Cheers,
Lennie
Oct 12 '10 #1

✓ answered by GaryTexmo

There is a property on a ListBox called ColumnWidth. It looks like all columns will be the same width on this control and that you can't specify headers. I think it's just to present the data in the list differently.

Perhaps you should look into a ListView control. Take a look at that, there should be a setting to create columns and size them independently. I believe there's also an auto size call you can make on the column so it sizes to the data in it. Let me know how that works for you.

2 2073
GaryTexmo
1,501 Expert 1GB
There is a property on a ListBox called ColumnWidth. It looks like all columns will be the same width on this control and that you can't specify headers. I think it's just to present the data in the list differently.

Perhaps you should look into a ListView control. Take a look at that, there should be a setting to create columns and size them independently. I believe there's also an auto size call you can make on the column so it sizes to the data in it. Let me know how that works for you.
Oct 12 '10 #2
lenniekuah
126 100+
Hi Gary,
Thank you for sharing information with me.
I will try out the ListView in C#NET. Years ago While using VB6 Iam very familiar with ListView.
Oct 13 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jakob Persson | last post by:
Hi Is there a way to program a DataGrid control to automatically adjust its columnwidth so it fits the contents of the columns. I am searching for a automated way to do the thing you do when...
0
by: Hannes | last post by:
Hello! When doubleclicking on the columnseparator of a datagrid the columnwidth ist set to the optimal size for the instantaneous content. Is there a possibility to activate this function...
0
by: Hannes | last post by:
Hello! When doubleclicking on the columnseparator of a datagrid the columnwidth ist set to the optimal size for the instantaneous content. Is there a possibility to activate this function...
1
by: Willem | last post by:
Hi, I'm using a datagrid on a webform with 4 visible and 1 invisible columns. When clicking a button I want to make the invisible column visible. I use the code DataGrid1.Columns(4).Visible =...
4
by: max | last post by:
I am not being a smartass and would honestly like an explanation, if you could take the time. What's wrong with: DataGrid.Column(0).Width = 30? or DataGrid.Column(2).Width = DataGrid.Width -...
5
by: matthewtec | last post by:
I see that it is possible to have a multicolumn ListBox: lstOne.MultiColumn = True lstOne.ColumnWidth = 10 but the only way I have seen to have the items in the listbox print in the next...
5
by: WRH | last post by:
Hello I want to have a multicolumn listbox. I never used one before so I looked at a Help example. I set the multicolumn property and the column width and tested with this example... ...
0
by: Marc | last post by:
Hello, I have converted a project from .NET2005 to .NET2008 RTM I have also converted the project to use .NET Framework3.5 (as the project will only be in Beta in a few month). My project is...
1
by: Medwar19 | last post by:
Hi all, I'm creating my Access tables using VBA and SQL. strSQL = "CREATE TABLE (<fieldname> AUTOINCREMENT) docmd.runsql strSQL I then want set each fields columnwidth property using: ...
2
by: lenniekuah | last post by:
Hullo Good Friends, I need your help. Please help me. I am using C#NET2008 to develop Window application I am trying to retrieve Sales Transaction and print it on WORD Document as statement...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.