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 8226837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:54:58+00:00 2026-06-07T15:54:58+00:00

I am working on a control to draw some graphs. For this purpose I

  • 0

I am working on a control to draw some graphs. For this purpose I want to derive a control from PictureBox and add a field to it which basically a List of following simple class:

public class Curve
{
     public List<PointF> DataPoints;
     public Color CurveColor;
     //and constructor and stuff
}

And the PictureBox class:

public class Graph : PictureBox
{
    List<Curve> Curves;
    //And some code to take care of drawing the curves
}

So I really apriciate some tips here, is there a way to hook up an event so whenever a Curve object is being added or removed in the Graph class, it redraws itself with remaining curve objects?

I found some details here here but this is for ArrayList

  • 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-07T15:55:00+00:00Added an answer on June 7, 2026 at 3:55 pm

    One way could be to use an ObservableCollection into your Graph class then listen to its CollectionChanged Event to Redraw your Graph.

    public class Graph : PictureBox {
        ObservableCollection<Point> Curves;
        //And some code to take care of drawing the curves
    
        public Graph() {
          Curves.CollectionChanged += Curves_CollectionChanged;
        }
    
        void Curves_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) {
          Redraw();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently, I have this version of the autocomplete control working when returning XML from
I am working in a Silverlight control where I need to upload some static
I'm working on a Silverlight templated control (i.e. it derives from Control and has
I've been working on this for quite some time looking for solutions in various
I am working on an ASP.net Ajax custom control, I have tried to derive
I'm using gluNurbsCurve to draw some curves with some control points. I've got the
I am working a e-commerce website (in asp.net & c#) where which I want
pretty new to vb and I want to get a tab control working. so
I have custom control where i want to show some items. In generic.xaml defined
I'm working on an app which needs to draw with OpengGL at a refresh

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.