Wrox Programmer Forums
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 26th, 2007, 08:04 AM
Registered User
 
Join Date: Mar 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tundewonder
Default Line text spacing Adjustment

How Can I adjust line spacing in VS2005?
I have display like this in my listbox:

1000 26
10000000 30

Can anyone help me to write code on how to adjust the spacing between the text.

thanks in advance
Ola

 
Old June 26th, 2007, 09:57 AM
Registered User
 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Change the font to Courier New and every item in the string you add will be the same length (you can add spaces).


Have a nice day
http://yulyos4vbnet.spaces.live.com
 
Old June 26th, 2007, 02:11 PM
Registered User
 
Join Date: Mar 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tundewonder
Default

Quote:
quote:Originally posted by yulyos
 Hi,

Change the font to Courier New and every item in the string you add will be the same length (you can add spaces).


Have a nice day
http://yulyos4vbnet.spaces.live.com
Thank very much for yout respond.
I change the font but still thesame.How can I write code for add spaces to it?

 
Old June 27th, 2007, 01:10 PM
Registered User
 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

First of all my suggestion is to use ListView.

Now about your question
You have to decide every item his fixed size (the biggest size), and then to add the spaces to
the item.

For example:
If the biggest length is 10 characters and you have an item that his size is 5 characters, add 5 spaces in the end of the string (item).
Code:
        Dim str As String = "12345"
        If str.Length < 10 Then
            str = str + Space(10 - str.Length)
        End If
Have a nice day
http://yulyos4vbnet.spaces.live.com
 
Old June 28th, 2007, 10:22 AM
Registered User
 
Join Date: Mar 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tundewonder
Default

Quote:
quote:Originally posted by yulyos
 Hi,

First of all my suggestion is to use ListView.

Now about your question
You have to decide every item his fixed size (the biggest size), and then to add the spaces to
the item.

For example:
If the biggest length is 10 characters and you have an item that his size is 5 characters, add 5 spaces in the end of the string (item).
Code:
        Dim str As String = "12345"
        If str.Length < 10 Then
            str = str + Space(10 - str.Length)
        End If
Have a nice day
http://yulyos4vbnet.spaces.live.com
Thanks for your concern.
But it doesn't work.
I am using Visual studio 2005 software and trying to program in Visual Basic.This is giving me problem.Perharps one I will know more on how to program very well.
 
Old June 28th, 2007, 11:18 AM
Registered User
 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I also using Visual studio 2005
and it's working OK

Have a nice day
http://yulyos4vbnet.spaces.live.com
 
Old June 29th, 2007, 12:53 AM
Registered User
 
Join Date: Jun 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to atilak_2001
Default

I recommend you to use list view instead of listbox. You can use multiple columns of list view.
Tell me more about your data and the method of fatching the data.

Positiveness is in my blood.. I'm O+.
 
Old July 3rd, 2007, 08:18 AM
Registered User
 
Join Date: Mar 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tundewonder
Default

Quote:
quote:Originally posted by atilak_2001
 I recommend you to use list view instead of listbox. You can use multiple columns of list view.
Tell me more about your data and the method of fatching the data.

Positiveness is in my blood.. I'm O+.
Thank you so much 0+

But I had solved the problem by this method

Private Function writeouttext3(ByVal a1 As String, ByVal a2 As String, ByVal a3 As String) As String

        Dim r As String ' Declaraction for line spacing
        r = Microsoft.VisualBasic.Right(Space(50) + a1, 10)
        r = r + Microsoft.VisualBasic.Right(Space(50) + a2, 20)
        r = r + Microsoft.VisualBasic.Right(Space(50) + a3, 24)
        Return (r)

    End Function

lstBoxsg.Items.Add(writeouttext3(Num1,Num2 , Num3))

It workout great!






Similar Threads
Thread Thread Starter Forum Replies Last Post
extracting multi-line text. Ceromus C# 0 November 7th, 2008 10:06 PM
concatenationg text fields into one line gregalb SQL Server 2000 2 July 2nd, 2007 11:20 PM
text on the same line Adam H-W CSS Cascading Style Sheets 2 February 19th, 2007 04:10 PM
Line spacing Stevie Dreamweaver (all versions) 3 May 16th, 2005 11:58 AM
How to retrieve last selected text line in text bo garetho General .NET 1 May 3rd, 2005 09:17 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.