ListView TextAlign broken for 1st column?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?UmF5IE1pdGNoZWxs?=

    ListView TextAlign broken for 1st column?

    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
  • =?Utf-8?B?U2l2YSBN?=

    #2
    RE: ListView TextAlign broken for 1st column?

    Hi,

    It is by design.

    <msdn
    url="http://msdn2.microsoft .com/en-us/library/system.windows. forms.columnhea der.textalign.a spx">
    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.DrawCo lumnHeader 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

    Comment

    • =?Utf-8?B?UmF5IE1pdGNoZWxs?=

      #3
      RE: ListView TextAlign broken for 1st column?

      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.columnhea der.textalign.a spx">
      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.DrawCo lumnHeader 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

      Comment

      Working...