none
Shape.AddText pixel error RRS feed

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.

    Saturday, July 19, 2014 8:17 AM
    Moderator

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



    Saturday, July 19, 2014 2:39 AM
    Moderator
  • 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.

    Saturday, July 19, 2014 8:17 AM
    Moderator
  • 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
    Moderator
  • 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
    Moderator