Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8203229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:28:43+00:00 2026-06-07T07:28:43+00:00

want to create a selectionRangeChanged event programatically not really getting how to do it

  • 0

want to create a selectionRangeChanged event programatically not really getting how to do it

enter image description here

 private void btn_10D_Click(object sender, EventArgs e)
    {
        double varRange = 10;
        double var_Sel1 = DatesX[0].ToOADate();

        Chart1.ChartAreas["ChartArea1"].CursorX.IsUserEnabled = true;
        Chart1.ChartAreas["ChartArea1"].CursorX.IsUserSelectionEnabled = true;
        Chart1.ChartAreas["ChartArea1"].CursorX.SelectionColor = Color.LightGray;
        Chart1.ChartAreas["ChartArea1"].CursorX.SelectionStart = var_Sel1;
        Chart1.ChartAreas["ChartArea1"].CursorX.SelectionEnd = varRange + var_Sel1;
        Chart1.ChartAreas["ChartArea1"].CursorX.Position = varRange + var_Sel1;
        Chart1.SelectionRangeChanged += new EventHandler<CursorEventArgs>(Chart1_SelectionRangeChanged);

    }

    void Chart1_SelectionRangeChanged(object sender, CursorEventArgs e)
    {
        throw new NotImplementedException();
    }

thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:28:45+00:00Added an answer on June 7, 2026 at 7:28 am

    For all events in C# is true that if class creator did not make extra effort to allow event firing form outside of class it is impossible to fire them.

    According to MSDN

    Chart.SelectionRangeChanged event Occurs when the selection start position or end position is changed.

    But from my tests I can see that it is fired only if it is changed by user not program.

    If I understand your intention correctly you want to handle those small buttons under your chart and btn_10D_Click method is a click handler for one of them. Try to move this line

    Chart1.SelectionRangeChanged += new EventHandler<CursorEventArgs>(Chart1_SelectionRangeChanged);
    

    to your constructor and ensure it is called once (remove it form other handlers). This will ensure your code is executed when user changes selection. If you want to execute same code for your button you should simply extract handler contents to method and call it form button click handler.

    void Chart1_SelectionRangeChanged(object sender, CursorEventArgs e)
    {
        DoSomething(/*some arguments if you need them*/);
    }
    private void btn_10D_Click(object sender, EventArgs e)
    {
         \\your code
         DoSomething();
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want create module which update list of usb devices automatically (not only mass
I want create a new JavaScript object based on an existing JavaScript object. Till
i want create date validation but not know why return is false? $data_go =
I want create object from Canvas3D class(in java) but my Compiler doesn't have this
I want create a form to upload files (txt, xls) to the server, not
I want create arrays with object keys in PHP, i.e. something like this: <?php
i want create multiple search where statement $where_search is a multiple condition from post
I want create wordpress website into which I want create user management... That means
i want create a custom json data from the mssql 2008 results so that
I want create an application with animate button? how can i do? after click

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.