Hello,
I'm using the VS 2005 Express Edition for C#. In the GUI designer, when I
try to set the text alignment to anything except Left for the first column of
a ListView, it jumps back to the left anyway, even thought choices of Center
and Right are shown in the drop-down. I've even tried modifying the code
itself after the fact but it merely ignores it. I remember this was a
problem in the original version of the product but I thought it would have
been fixed by now. Are there any workarounds, or am I simply doing something
wrong? Previously I just created a dummy 1st column with 0 width, but that's
a real kluge.
Thanks,
Ray 2 5896
Hi,
It is by design.
<msdn
url="http://msdn2.microsoft.com/en-us/library/system.windows.forms.columnheader.textalign.aspx">
Due to a limitation in the underlying control, this property has no effect
on the first column in the ListView control, which is always aligned to the
left. To work around this limitation in Microsoft .NET Framework version 2.0,
you can handle the ListView.DrawColumnHeader event and paint the column
header yourself.
</msdn>
"Ray Mitchell" wrote:
Hello,
I'm using the VS 2005 Express Edition for C#. In the GUI designer, when I
try to set the text alignment to anything except Left for the first column of
a ListView, it jumps back to the left anyway, even thought choices of Center
and Right are shown in the drop-down. I've even tried modifying the code
itself after the fact but it merely ignores it. I remember this was a
problem in the original version of the product but I thought it would have
been fixed by now. Are there any workarounds, or am I simply doing something
wrong? Previously I just created a dummy 1st column with 0 width, but that's
a real kluge.
Thanks,
Ray
Siva,
Thanks for the response. I figured as much - call a "bug" a "feature" and
charge more (although the Express edition is free!). Hopefully this
"feature" will be deprecated in a later version. It seems that they should
remove the "Center" and "Right" choices from the TextAlign menu for that
colum if they're not going to support them, however. I'm just learning this
stuff so I can't really complain, though, since so many things work so nicely.
Ray
"Siva M" wrote:
Hi,
It is by design.
<msdn
url="http://msdn2.microsoft.com/en-us/library/system.windows.forms.columnheader.textalign.aspx">
Due to a limitation in the underlying control, this property has no effect
on the first column in the ListView control, which is always aligned to the
left. To work around this limitation in Microsoft .NET Framework version 2.0,
you can handle the ListView.DrawColumnHeader event and paint the column
header yourself.
</msdn>
"Ray Mitchell" wrote:
Hello,
I'm using the VS 2005 Express Edition for C#. In the GUI designer, when I
try to set the text alignment to anything except Left for the first column of
a ListView, it jumps back to the left anyway, even thought choices of Center
and Right are shown in the drop-down. I've even tried modifying the code
itself after the fact but it merely ignores it. I remember this was a
problem in the original version of the product but I thought it would have
been fixed by now. Are there any workarounds, or am I simply doing something
wrong? Previously I just created a dummy 1st column with 0 width, but that's
a real kluge.
Thanks,
Ray
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: rmorvay |
last post by:
I have successfully integrated sorting in the listview control with the
following code:
Private Sub ListView_ColumnClick(ByVal sender As Object, ByVal e As...
|
by: VM |
last post by:
How can I fill up a listview with text file contents?
My listview has two columns and the first column fills up with a while loop:
while (myString != null)
{
myString = sr.Readline();...
|
by: Ray Mitchell |
last post by:
I'm using VS 2002 w/available component updates. I am creating a listview
with multiple columns. When I use the "ColumnHeader Collection Editor" to
specify that the header titles are to be...
|
by: John T |
last post by:
I have the code I need to show a sort icon in the column header of a
ListView control. The issue I have is that the image is always on the right
side of the column header text.
This isn't...
|
by: willow1480 |
last post by:
I am developing a small little Service Control Application. I am
using a listview control with checkboxes and getting the list of
services I want to control from a text file. When you check a...
| |
by: Li Pang |
last post by:
Hi,
I used some code to add an arrow icon onto a listview header column for the
sorting purpose. However, after the icon added, the TextAlign of the column
becomes "left", if I enforced...
|
by: Dennis |
last post by:
I have a form which has a ListView control named ListView1 added at design
time. When I add items using the following code, they don't appear in the
list view. However, if I create a ListView...
|
by: Terry Olsen |
last post by:
Does anyone have an example of how I could print a ListView control? It'd
sure be easier to do this than to try to format the output in DrawStrings...
Thanks.
|
by: Johnny Jörgensen |
last post by:
The listview control's column items contain a property called TextAlign
which apparently can be either Left, Right or Center. But if you choose
anything but Left (default) the property value is...
|
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,...
|
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...
| |
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: 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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |