ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Left of Text in TextBoxes
Posted by Dan on Feb-03-2017 17:05
Attachments:
Hi,

I notice that it is difficult for me to align textBoxes with different fontsizes since it seems as the text start coordinate in the x plane is depending on fontsize and I suppose font.


Is there a way for me to position text so it aligns properly in the x-plane easily or do I need to do some fontbased calculations myself?


Maybe I missed something obvious in the API.
Skärmavbild 2017-02-03 kl. 09.56.36.png

  Re: Left of Text in TextBoxes
Posted by Peter Kwan on Feb-04-2017 03:24
Hi Dan,

The issue is not related to the text, but to the left and right margins inside the text box. If the margins are not configured, it will be set automatically and will depend on the main font size.

As a test, you can configure the margins to be 0, and the text will be aligned just like in a word processor. In VB6,

Set t = c.addText(......)
Call t.setMargin(0)    'Set left/top/right/bottom margins to 0

See:

http://www.advsofteng.com/doc/cdcom.htm#TextBox.setMargin.htm
http://www.advsofteng.com/doc/cdcom.htm#TextBox.setMargin2.htm

Hope this can help.

Regards
Peter Kwan

  Re: Left of Text in TextBoxes
Posted by Dan on Feb-04-2017 04:09
Works perfect!


Thanks