Showing results 1 to 3 of 3

Thread: Align Static Text on Screen

  1. #1
    Join Date
    04.06.2018
    Posts
    1

    Default Align Static Text on Screen

    I create static text dynamically on screen with command:


    Dim obProject as Project
    Set obProject = MyWorkspace.ActiveDocument

    Dim obPicture as DynPicture
    Set obPicture = obProject.DynPicture.Item(0)

    Dim newElement as Element
    Set newElement = obPicture.Elements.Create("new_text", tpText)

    newElement.DynProperties("Text") = "Text 1"
    newElement.DynProperties("HorizontalAlign") = 0 '0 -> Left
    newElement.DynProperties("VerticalAlign") = 0 '0 -> Centered, 1 - > Bottom, 2 -> Top



    When I set 'HorizontalAlign' with value 0 the text alignment is Left, but, with value 1 or 2 not work. Whats values I need use for centered or right alignment?

  2. #2
    Join Date
    17.03.2016
    Posts
    37

    Default Re: Align Static Text on Screen

    Did some experimenting on this as I was curious while investigating a similar issue.

    For some reason the values seems to be:

    Left = 0
    Center = 8
    Right = 4

    Found these by setting values manually & then using some code to show me the value that was set in a msgbox

    Code:
    MsgBox elElement.DynProperties("HorizontalAlign")
    Would be nice if this sort of thing was in the API documentation (if it is I haven't found it by searching)

  3. #3
    Join Date
    17.03.2016
    Posts
    37

    Default Re: Align Static Text on Screen

    Sorry, 1= left.

Similar Threads

  1. Static text box to blink
    By afz2004 in forum zenon Supervisor
    Replies: 2
    Last Post: 26th September 2018, 06:39
  2. Static text box to blink
    By afz2004 in forum zenon Energy Edition
    Replies: 2
    Last Post: 26th September 2018, 06:39
  3. Replies: 4
    Last Post: 25th January 2017, 00:28
  4. DynProperties("Text") of a static text
    By jurijcadez in forum VBA
    Replies: 3
    Last Post: 12th June 2012, 14:09
  5. Replies: 2
    Last Post: 21st June 2010, 08:42

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •