Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Preventing selection of objects drawn in OnRender

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

    Preventing selection of objects drawn in OnRender

    Hello,

    I have an indicator that shades portions of the chart canvas, amongst other things. I DO want to be able to double click / select the plots on the chart from the same indicator, but I don't want the chart regions to be selectable. They are drawn with Draw.FillRectangle. The issue is, clicking almost anywhere on the chart selects one of these objects, which is undesirable. I read in the d2d docs there was a way of doing this without the click events etc attached, which was good for performance etc, too. Is this possible. Selectively draw an object such as a rectangle, and have it not interact with the user, whilst leaving the rest normal?

    I know I can disable all for the indie user interaction with HitTest, and via the chart properties for all, but that is not what I want. I just want to prevent it for single drawn objects. I hope this makes sense.

    Thanks.

    #2
    Hello pjsmith,

    Thank you for your post.

    Custom render code that you do not want to be clickable should be placed within if (!IsInHitTest). IsInHitTest determines if objects drawn in the chart object should be selectable in the hit test. procedure.

    See the help guide documentation below for more information.
    IsInHitTest - https://ninjatrader.com/support/help...sinhittest.htm
    Rendering - https://ninjatrader.com/support/help.../rendering.htm

    Let us know if we may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    566 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    547 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X