locked
Shape.AddText pixel error RRS feed

  • Question


  • Show ZKP024

    Result:


    • Edited by martmen Friday, July 18, 2014 11:34 PM
    Friday, July 18, 2014 11:21 PM

Answers

  • Or just change the text rather than removing and adding things (you have to be very consistent if you do it that way).

    Shapes.SetText(SHText,tree[LDControls.LastTreeViewIndex][index[1]])

    If you go the Remove - Add way I suggest you ALWAYS do a Shapes.Remove IMMEDIATELY before the Shapes.Add for the shape you are adding. 

      Shapes.Remove(SHText )
      SHText = Shapes.AddText(tree[LDControls.LastTreeViewIndex][index[1]])

    This is like Nonki's suggestion, but I think the SetText is easier than removing and then adding.

    • Proposed as answer by Jibba j Sunday, July 27, 2014 1:06 AM
    • Marked as answer by WhTurner33Editor Friday, August 8, 2014 1:31 PM
    Saturday, July 19, 2014 8:17 AM

All replies

  • I think you should remove SHText instead of SHNumber before the next Shapes.AddText() in line 65.

    Or how about do like this:

    If SHText <> "" Then
      SHText = Shapes.AddText(txt)
      Shapes.Move(SHText, x, y)
    Else
      Shapes.SetText(SHText, txt)
    ElseIf
    I guess that OnTreeViewItemChanged is called before the first creating of SHText in line 34.


    Nonki Takahashi



    • Edited by Nonki Takahashi Saturday, July 19, 2014 3:01 AM minor change
    • Proposed as answer by Jibba j Sunday, July 27, 2014 1:07 AM
    Saturday, July 19, 2014 2:39 AM
  • Hy Nonki,

    but in line 48 to 57 it is ok. What is the different?

    Or it is better there need also the command Shape.SetText(SHNumber)?

    Sorry for my bad english.

     

    Best Regards Martin

    Saturday, July 19, 2014 6:05 AM
  • Or just change the text rather than removing and adding things (you have to be very consistent if you do it that way).

    Shapes.SetText(SHText,tree[LDControls.LastTreeViewIndex][index[1]])

    If you go the Remove - Add way I suggest you ALWAYS do a Shapes.Remove IMMEDIATELY before the Shapes.Add for the shape you are adding. 

      Shapes.Remove(SHText )
      SHText = Shapes.AddText(tree[LDControls.LastTreeViewIndex][index[1]])

    This is like Nonki's suggestion, but I think the SetText is easier than removing and then adding.

    • Proposed as answer by Jibba j Sunday, July 27, 2014 1:06 AM
    • Marked as answer by WhTurner33Editor Friday, August 8, 2014 1:31 PM
    Saturday, July 19, 2014 8:17 AM
  • Line 48 to 57 is for SHNumber.  SHNumber is not redrawn in event handler like OnTreeViewItemChanged.  So, these lines run well.

    Nonki Takahashi

    Monday, July 21, 2014 9:50 AM
  • Hi martmen

    I commented out the AddText and used SetText:  ZKP024-0

      'SHText = Shapes.AddText(tree[LDControls.LastTreeViewIndex][index[1]]) 'COMMENTED THIS
      
      Shapes.Move(SHText, 110, 290)
      
      Shapes.SetText(SHText, tree[LDControls.LastTreeViewIndex][index[1]]) 'ADDED THIS
    It seems to fix the overwriting.
    Sunday, July 27, 2014 1:04 AM