Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 - Where to define MouseEvents

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

    NT8 - Where to define MouseEvents

    Hello,

    I would like to use MouseEvents like these:

    ChartPanel.MouseLeftButtonUp += new MouseButtonEventHandler(myMouseEvents);

    ChartPanel.MouseLeftButtonUp -= midasMouseEvents;

    Where do i have to define them?

    Currently they are located in State.Configure and State.Terminated but i get some errors in the Ouput:

    Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.

    Thank you,
    Mike

    #2
    Hello,

    Thank you for the question.

    In general the error Object reference not set to an instance of an object indicates that in one of these states, the object you are trying to use is null.

    This could potentially be caused by the nature of the states in combination with not checking if the object is null.

    To start you can try adding a null check, this should resovle the error you are getting.


    Code:
    if(ChartPanel != null)
    {
       // execute code
    }
    Also you may want to move this logic to State.Historical, ChartControl and its sub objects should only be accessed from State.Historical and after, this likely would include the charts panel as well.

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    598 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    343 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    556 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    555 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X