Listbox Alignment
Listbox Alignment
Listbox Alignment
Listbox Alignment
Listbox Alignment
Listbox Alignment Listbox Alignment Listbox Alignment Listbox Alignment Listbox Alignment Listbox Alignment Listbox Alignment Listbox Alignment
Listbox Alignment Listbox Alignment
Listbox Alignment
Go Back  Xtreme Visual Basic Talk > > > Listbox Alignment


Reply
 
Thread Tools Display Modes
  #1  
Old 10-20-2014, 06:31 AM
Hexion Hexion is offline
Newcomer
 
Join Date: Oct 2014
Posts: 6
Default Listbox Alignment


I am currently trying to create a shopping list.

Is it possible to have the item aligned on the left and the price aligned to the right (on the same line of course)

If it is not possible any alternative solutions would be much helpful!

Thank you
Reply With Quote
  #2  
Old 10-20-2014, 07:39 AM
Flyguy's Avatar
FlyguyListbox Alignment Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 19,165
Default

The listbox does not support multiple columns out of the box.
Better have a look at the ListView or the MS(H)FlexGrid controls.
Reply With Quote
  #3  
Old 10-20-2014, 08:37 AM
Hexion Hexion is offline
Newcomer
 
Join Date: Oct 2014
Posts: 6
Default

Ok, Thank you

I was hoping it would be something simple like:

Listbox1.items.add(Item & (price, alignment.right))

Wishful thinking.... I shall have a look at them now, thank you for your help

Last edited by Hexion; 10-20-2014 at 08:45 AM.
Reply With Quote
  #4  
Old 10-20-2014, 12:22 PM
Gruff's Avatar
GruffListbox Alignment Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

The only work around with a standard listbox is if one of the fields is of a fixed number of characters. You can put those on the left and pad with a fixed number of spaces.

The MSH flexgrid is not all that difficult to use for the basics though it does have a ton of options that can seem daunting.

I'd do as Flyguy suggests.
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
  #5  
Old 10-20-2014, 12:48 PM
Hexion Hexion is offline
Newcomer
 
Join Date: Oct 2014
Posts: 6
Thumbs up

Changed it to listview rather than a listbox and working great now thank you for help
Reply With Quote
  #6  
Old 10-22-2014, 03:13 AM
Flyguy's Avatar
FlyguyListbox Alignment Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 19,165
Default

Based on your other thread I moved this thread to the VB.Net section.
For .Net other advices and/or controls might be more suitable.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Listbox Alignment
Listbox Alignment
Listbox Alignment Listbox Alignment
Listbox Alignment
Listbox Alignment
Listbox Alignment Listbox Alignment Listbox Alignment Listbox Alignment Listbox Alignment Listbox Alignment Listbox Alignment
Listbox Alignment
Listbox Alignment
 
Listbox Alignment
Listbox Alignment
 
-->