[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2004-04-29
9
Medium Priority
?
150 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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

650 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