Results 1 to 8 of 8

Thread: VB2010 Express: ListView Column Alignment Will Not Allow Change to Center

  1. #1

    Thread Starter
    Hyperactive Member Vladamir's Avatar
    Join Date
    Feb 2012
    Location
    Miami, FL
    Posts
    486

    VB2010 Express: ListView Column Alignment Will Not Allow Change to Center

    I have built a listview using the Details view, with five columns in it. I have named all the columnheaders and set the text alignment in each one to be centered. However, the first one on the left will not allow me to set it to anything but Left alignment. I have tried to change it more than once and no matter what I do in the properties dialog box with this setting is sticks on Left. The column header text in all the other fields aligns to the center.

  2. #2

    Re: VB2010 Express: ListView Column Alignment Will Not Allow Change to Center

    Have you tried changing it via code?

  3. #3

    Thread Starter
    Hyperactive Member Vladamir's Avatar
    Join Date
    Feb 2012
    Location
    Miami, FL
    Posts
    486

    Re: VB2010 Express: ListView Column Alignment Will Not Allow Change to Center

    I tried editing the Form1.Designer.vb file, which I understand is highly undesirable method of doing it. But it did not make any change and it did not cause any harm. I changed the file back to the way it was. I've been clicking on rebuild to make sure all the changes are there and it's not helping either.

    I searched for how to do it with code, but the darn thing about listview is that most people seem to use icons, not details. Have not found anything on how to fix this yet. It's the first column on the left of the listview which is stuck with the left alignment. And it's weird because in the Form1.Designer.vb file, this header entry is the only one which does not have an alignment setting. All the others do.

  4. #4

    Re: VB2010 Express: ListView Column Alignment Will Not Allow Change to Center

    Quote Originally Posted by Vladamir View Post
    I tried editing the Form1.Designer.vb file, which I understand is highly undesirable method of doing it. But it did not make any change and it did not cause any harm. I changed the file back to the way it was. I've been clicking on rebuild to make sure all the changes are there and it's not helping either.

    I searched for how to do it with code, but the darn thing about listview is that most people seem to use icons, not details. Have not found anything on how to fix this yet. It's the first column on the left of the listview which is stuck with the left alignment.
    It appears the first column of a ListView cannot have the alignment changed. This is apparently by design. I found an old thread here that has a workaround.
    Last edited by formlesstree4; Apr 12th, 2013 at 01:40 PM. Reason: Redundant statements are very redundant...

  5. #5

    Thread Starter
    Hyperactive Member Vladamir's Avatar
    Join Date
    Feb 2012
    Location
    Miami, FL
    Posts
    486

    Re: VB2010 Express: ListView Column Alignment Will Not Allow Change to Center

    You know I was beginning to think something weird like this was up. Oh, if the folks who develop these apps only had to work with them on a daily basis...they'd certainly build them differently.

  6. #6

    Re: VB2010 Express: ListView Column Alignment Will Not Allow Change to Center

    Quote Originally Posted by Vladamir View Post
    You know I was beginning to think something weird like this was up. Oh, if the folks who develop these apps only had to work with them on a daily basis...they'd certainly build them differently.
    Microsoft actively practices "dogfooding", or "eating your own dog food", so I'm hoping they did extensive testing on this and had a legitimate reason to do what they did. I mean, usually speaking, people throw images into the first column (or don't really need an alignment change), and simply hiding it doesn't cause any real problems. It's totally silly, and if you really wanted to, you could probably derive your own ListView control that allows for that first column to have its alignment changed.

  7. #7
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: VB2010 Express: ListView Column Alignment Will Not Allow Change to Center

    Er ... you do realise that Windows explorer uses a standard listview, right? Can't imagine the number of people wanting it any other way requiring more than a couple of hands to count it on. Center alignment is not favoured by any style guide for journalism, academic writing, science reports etc. that I know of.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  8. #8

    Re: VB2010 Express: ListView Column Alignment Will Not Allow Change to Center

    Quote Originally Posted by dunfiddlin View Post
    Er ... you do realise that Windows explorer uses a standard listview, right? Can't imagine the number of people wanting it any other way requiring more than a couple of hands to count it on. Center alignment is not favoured by any style guide for journalism, academic writing, science reports etc. that I know of.
    Example!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width