User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 401,485 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,240 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Views: 516 | Replies: 8
Reply
Join Date: Oct 2007
Posts: 85
Reputation: zawpai is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
zawpai zawpai is offline Offline
Junior Poster in Training

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

  #1  
Jun 9th, 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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2008
Location: Sivakasi, Tamilnadu, India
Posts: 396
Reputation: selvaganapathy is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 67
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Whiz

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

  #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  
Join Date: Oct 2007
Posts: 85
Reputation: zawpai is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
zawpai zawpai is offline Offline
Junior Poster in Training

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

  #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 Images
File Type: jpg problem.JPG (11.4 KB, 2 views)
Reply With Quote  
Join Date: Feb 2008
Location: Sivakasi, Tamilnadu, India
Posts: 396
Reputation: selvaganapathy is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 67
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Whiz

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

  #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  
Join Date: Oct 2007
Posts: 85
Reputation: zawpai is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
zawpai zawpai is offline Offline
Junior Poster in Training

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

  #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  
Join Date: Nov 2006
Posts: 711
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 97
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Master Poster

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

  #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 3:32 am.
Reply With Quote  
Join Date: Oct 2007
Posts: 85
Reputation: zawpai is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
zawpai zawpai is offline Offline
Junior Poster in Training

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

  #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  
Join Date: Nov 2006
Posts: 711
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 97
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Master Poster

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

  #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  
Join Date: Feb 2008
Location: Sivakasi, Tamilnadu, India
Posts: 396
Reputation: selvaganapathy is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 67
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Whiz

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

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 2:10 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC