Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Removing last draw object, but not all of them?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Removing last draw object, but not all of them?

    Hi, How would I be able to remove just my last draw object, but not all of them.

    If ( User Defined)
    {
    Draw.Text(this, "PVolD" + CurrentBar.ToString(), false,
    Convert.ToString(PowerPlay(Brushes.Transparent, Brushes.Transparent)[1]), 0,
    High[0]+2*TickSize, 0, Brushes.Black, myFont, TextAlignment.Center,
    Brushes.Transparent, Brushes.Transparent, 2);

    RemoveDrawObject("PVolD"+ (????????));
    }


    Thanks, Woody.

    #2
    Hello Woody,

    Thanks for your post.

    When you write your text, store the current bar number in another int variable (maybe called myLastBar).

    For example:

    DrawText (all your stuff....);
    myLastBar = CurrentBar;


    Then to remove:

    RemoveDrawObject ("PVold"+myLastBar);

    Alternatively, instead of you using CurrentBar to create a unique tag name, create and use an integer counter that is increment each time you draw text to create the unique tag name and this way the integer counter will have the last value used.

    Comment


      #3
      Thanks Paul. That did the trick. Very, Very helpful. Thanks again, Woody!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      580 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      335 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      102 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X