Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 559
  • Last Modified:

RTF Alignment

There does not appear to be any way to align both margins of a paragraph using RTF control. Has anyone got code to do this.
0
sbmc
Asked:
sbmc
  • 5
  • 4
1 Solution
 
mcixCommented:
What is it your are trying to accomplish?
0
 
sbmcAuthor Commented:
Im trying to align both margins of a paragraph as in Word.
0
 
blwatkinsCommented:
There is no way to make a RTF control do what you want, The correct words is "Full Justification" this will make both sides of the text be alligned.  

The only way to achieve this is to Use the Microsoft Control "OLE" and make its .class be a word document.  Then you can format the text inside of the control with any formating you can do in word (such as : Full Justification).  This box will look just like a text box control.


0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
sbmcAuthor Commented:
Can you elaborate on the OLE solution ie code example.

Thanks
0
 
blwatkinsCommented:
don't need any code to perform this.  Just open vb, drop an ole object on the form, and pick work from the object type.  Put your text in the box, Highlight the text and right click for a menu and select paragraph formating, and change it from left alignment to "Justified",

Let me know if this isn't enough.

Thanks Brad.

0
 
sbmcAuthor Commented:
Brad

I've tried using the OLE object but how do you resize it and save the data you enter.


Thanks


Dave
0
 
blwatkinsCommented:
you want to resize the control at runtime?  and save the data at runtime or at developmnet?

0
 
sbmcAuthor Commented:
The OLE object seems to determine its own size at run time regardless of the size you  initially create it. At runtime the File menu is not present so how do you save the data?

0
 
blwatkinsCommented:
Use the OLE Save to FILE Statement to save it.
and the resize the control in the Form.Load event.

Make sure to do a DoEvents after resizeing the form.

0
 
sbmcAuthor Commented:
OK thanks for your help.


Dave
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now