Results 1 to 2 of 2

Thread: Center text in a Listbox [C# 2002]

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2003
    Posts
    308

    Question Center text in a Listbox [C# 2002]

    I was wondering if there was a way to CENTER text in a ListBox - specifically I have a listbox (lbInformation) to which I add items

    [lbInformation.Items.Add(sItem);] and I would like this to be displayed in the listbox as CENTERED text (not default left-justified) however I can't seem

    to find any settings or properties that allows me to set the text positioning - is there a simple way to achieve this?

    Any help would be much appreciated.
    Thanks,

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Center text in a Listbox [C# 2002]

    I think you'd have to set the DrawMode to OwnerDrawFixed and then draw the item text centred yourself.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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