I have three values I need to align in a dropdown box. How can I do this? I've been trying this:
String.Format("{0,-30}{1,-15}{2,-10}{3,-8}", new object[] { cusJob, service, username, time });
But that leaves it uneven because it's not a monospaced font. I don't really want to use a monospaced font and I've seen applications align it before so how can I do it?
Thanks.
You need to set the DropDownList's DrawMode to OwnerDrawFixed and render the items in the DrawItem event handler.
Examples are here and here and here, but there are lot more to be found on the web, if you search for "dropdownlist ownerdraw columns drawmode".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With