Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
250
text align item in listview
posted

i have a list view box where i want to align some of the text in each row. im filling the listview with the code below but i want to align the first character of dr("sUserID") at a specific point. but when i put it at the 25th character, they arent lined up correctly because each character takes up varying amounts of space. such as M would be long than an I. any help i would really appreciate, thank you

    lstUsers.Items.Add(Convert.ToString(dr("sUserID")), Convert.ToString(dr("sLastName")) & ", " & Convert.ToString(dr("sFirstName")) & sleft & "- " & Convert.ToString(dr("sUserID"))).Appearance.Image = My.Resources.man
Parents
No Data
Reply
  • 69832
    Verified Answer
    Offline posted

    You would have to either use a monospace font, or use the Details view and add a SubItemColumn for each DataColumn you are displaying.

Children
No Data