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

  • Home
  • SEARCH
  • 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 8348475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:42:01+00:00 2026-06-09T07:42:01+00:00

On a ZedGraph pane, it is possible to set a CurveItem as selected. zedGraphControl.GraphPane.CurveList[0].IsSelected

  • 0

On a ZedGraph pane, it is possible to set a CurveItem as “selected”.

zedGraphControl.GraphPane.CurveList[0].IsSelected = true;
zedGraphControl.Refresh();

This will change its color to Color.Gray as far as I can see.

Is it possible to change this selected-state color?

  • 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-09T07:42:02+00:00Added an answer on June 9, 2026 at 7:42 am

    I don’t know of such a property but you can accomplish this by manually overriding the MouseClick event of the ZedGraphControl and set the color of the “selected” CurveItem, something like:

    private void zedGraphControl1_MouseClick(object sender, MouseEventArgs e)
        {
            foreach (var curve in zedGraphControl1.GraphPane.CurveList)
            {
                curve.Color = Color.Black;
            }
    
            CurveItem nearestItem;
            int nearestPoint;
            zedGraphControl1.GraphPane.FindNearestPoint(e.Location, out nearestItem, out nearestPoint);
            if (nearestItem != null)
            {
                nearestItem.Color = Color.Red;
            }
            zedGraphControl1.Refresh();
        }
    

    UPDATE: Looking at the source code of http://www.opensourcejavaphp.net/csharp/zedgraph/Line.cs.html and http://www.opensourcejavaphp.net/csharp/zedgraph/Selection.cs.html it seems that Line.DrawCurve is using static property Selection.Line. Without modifying source it would be hard to change this behaviour.

    Part of Line.cs:

    public void DrawCurve( Graphics g, GraphPane pane, CurveItem curve, float scaleFactor )
    {
        Line source = this;
        if ( curve.IsSelected )
            source = Selection.Line;
    

    Selection.cs:

    /// The <see cref="Line" /> type to be used for drawing "selected"
    /// <see cref="LineItem" /> and <see cref="StickItem" /> types
     /// </summary>
    public static Line Line = new Line( Color.Gray );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ZedGraph to show Japanese candles. I set the GraphPane.isShowPointValue=true, but when
I draw a line in a zedgraph pane, but sometimes it will be like
When you use Zedgraph for linegraphs and set IsSmooth to true, the lines are
I am drawing a curve in Zedgraph like this: GraphPane myPane = zgc.GraphPane; PointPairList
I'm trying to remove a specific graph object from the zedgraph, is it possible....?
I wonder, is it possible to create vertical marker in zedgraph ? I want
I have a program that adds LineItems to a ZedGraph pane whenever data parameters
I am using ZedGraph's master pane to display two graphs that have synchronized X
I'm using ZedGraph to plot a very large data set (ranges from 500,000 data
I got a histogram drawn in ZedGraph. And I have to set the specific

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.