?
Solved

How to make a string aligned (Left and Right) in a text box

Posted on 2004-04-29
9
Medium Priority
?
148 Views
Last Modified: 2010-05-02
How can I make the string that are encoded in a text box be Left justified and Right justified. Just like when using MS Word where in you make the paragraph aligned both at the Left and Right margin
0
Comment
Question by:Jozin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
9 Comments
 
LVL 9

Expert Comment

by:p_sie
ID: 10947328
If you want all the text in a textbox aligned to one side, then use the alignment property of the textbox.

Textbox1.Alignment = 0 (left-align)
Textbox1.Alignment = 1 (right-align)
Textbox1.Alignment = 2 (center-align)

If you want left and right align in one textbox, I don't know
0
 

Author Comment

by:Jozin
ID: 10947673
Thanks,

What I want to know is Left and Right alignment at the same time.
0
 
LVL 9

Accepted Solution

by:
p_sie earned 200 total points
ID: 10947723
Don't think that is possible in a textbox
Maybe you could use the rich textbox (add it in the component list) there you have the setalignment property, which you can set per paragraph.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 9

Expert Comment

by:p_sie
ID: 10948679
Tested something:

do the following
add a rich text control to a form and name it RT
add a button to the form

paste the following code in the form's code window

Private Sub Command1_Click()

    RT.SelAlignment = 1
End Sub

Private Sub Form_Load()

    RT.Text = "Bike" & vbCrLf & "test" & vbCrLf & vbCrLf & "car"
   
End Sub

now select a line and press the button, the line will be rightaligned!
to make it center aligned use  RT.SelAlignment = 2 and left aligned : RT.SelAlignment = 0

Good luck
0
 
LVL 9

Expert Comment

by:p_sie
ID: 11257212
I think I gave all the info what the asker needed!
0
 
LVL 22

Expert Comment

by:DarkoLord
ID: 11977340
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
Accept p_sie's comment as an answer

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

DarkoLord
EE Cleanup Volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month10 days, 6 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question