Can't do the aligment "label" and "list box's string"

Reply

Join Date: Oct 2007
Posts: 95
Reputation: zawpai is an unknown quantity at this point 
Solved Threads: 0
zawpai zawpai is offline Offline
Junior Poster in Training

Can't do the aligment "label" and "list box's string"

 
0
  #1
Jun 10th, 2008
Hi,

Could anyone give me some suggestions? Now, I want to put the labels beside the list box to show the number of string lines, but i cant' do adjust all between string lines and labels although the size of text are same. You all will know the smallest size of text is '8'.

how should I do it?

Regards,

zawpai
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 509
Reputation: selvaganapathy is an unknown quantity at this point 
Solved Threads: 88
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Pro

Re: Can't do the aligment "label" and "list box's string"

 
0
  #2
Jun 10th, 2008
Hi,
To format controls use Format menu in the VB IDE
To Make Same side, Select the Controls then
Go Format Menu -> Make Same Size.
Similarly
To Make Align Use Format -> Align

List Box having integral height property, set it to false may help u.
KSG
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 95
Reputation: zawpai is an unknown quantity at this point 
Solved Threads: 0
zawpai zawpai is offline Offline
Junior Poster in Training

Re: Can't do the aligment "label" and "list box's string"

 
0
  #3
Jun 10th, 2008
Hi selvaganapathy,

I think you are misunderstanding my question. The following attachment is the problem when i execute the code.

Could you please open and see the attachment? I think you will see what the problem is.

Regards,
zawpai
Attached Thumbnails
problem.JPG  
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 509
Reputation: selvaganapathy is an unknown quantity at this point 
Solved Threads: 88
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Pro

Re: Can't do the aligment "label" and "list box's string"

 
0
  #4
Jun 11th, 2008
Hi zawpai,
Sorry for the misunderstanding. To Align the label, you must know the each position of the items in the listbox. but it cannot get in VB (I think). For this you must use APIs.

Another idea is why dont use again listbox instead of Labels. Set the background for labels to form background
KSG
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 95
Reputation: zawpai is an unknown quantity at this point 
Solved Threads: 0
zawpai zawpai is offline Offline
Junior Poster in Training

Re: Can't do the aligment "label" and "list box's string"

 
0
  #5
Jun 11th, 2008
Hi selvaganapathy,

For this you must use APIs.
Which API should I use?

May be your suggestion is a good ideal using the list box again as labels. I will think about it more.

Thanks,

zawpai
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: Can't do the aligment "label" and "list box's string"

 
0
  #6
Jun 11th, 2008
Hi,

Why use API's..?
Just Populate List Box with Serial Numbers and List Items.....
Use "Courier New Font" (Uni-distant font) for the List Box..
and check this :

  1. List1.AddItem "1" & Space(3) & "ABC"
  2. List1.AddItem "2" & Space(3) & "DEF"
  3. List1.AddItem "3" & Space(3) & "TTT"
  4. List1.AddItem "4" & Space(3) & "OERI"


Regards
Veena
Last edited by QVeen72; Jun 11th, 2008 at 4:32 am.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 95
Reputation: zawpai is an unknown quantity at this point 
Solved Threads: 0
zawpai zawpai is offline Offline
Junior Poster in Training

Re: Can't do the aligment "label" and "list box's string"

 
0
  #7
Jun 11th, 2008
Hi QVeen72,

Your suggestions is good, but I don't want to put any extra string in my List box because that the text shown in listbox will be related with the whole project. If I change something in list box, I need to change the whole program. So, I just put the label beside it.
That's why I got the problem.

Is there any way to adjust the string size of the list box?

Thanks,
zawpai
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: Can't do the aligment "label" and "list box's string"

 
0
  #8
Jun 11th, 2008
Hi,

Yes you can..
Make Font Name and Font Size of both label and List Box same..

Regards
Veena
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 509
Reputation: selvaganapathy is an unknown quantity at this point 
Solved Threads: 88
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Pro

Re: Can't do the aligment "label" and "list box's string"

 
0
  #9
Jun 11th, 2008
Hi,
Another idea why don't you use ListView control (Microsoft Common Control), or FlexGrid Control to display your data in Two Columns. Both controls supports multiple columns. You can display number in one column and your data in another column
KSG
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC