Solved

Circle Class

Posted on 2013-11-06
7
182 Views
Last Modified: 2013-11-13
I need to write a class that presents graphically as a circle.

My first stumbling block is that the Ellipse class is NotInheritable.

How should I proceed ?
0
Comment
Question by:Dodsworth
  • 4
  • 3
7 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
Just create a class which uses Ellipse class to draw itself?
0
 
LVL 1

Author Comment

by:Dodsworth
Comment Utility
Hmm.. I've been pondering your suggestion for a week now.

My Circle class is uses most of the properties and methods of the ellipse class but I need to link in additional data (createddate, updateddate, owner, etc)

In previous projects I'd inherit a button, as it has all the properties and events that I need, but this requirement is all about circles.  Why can't I inherit an ellipse anyway ?

I'm tempted to write some bad code and parse the additional properties out of .tag !

Any ideas on a less dirty approach ?
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
Comment Utility
Yeah given the problem that ellipse is not inheritable for some reason, the two options are to create a class which uses ellipse to render itself or use the ellipse class itself and store the additional information in tag property.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 1

Author Comment

by:Dodsworth
Comment Utility
I've only ever parsed out strings from a .tag but just noticed..

Public Property Tag As Object

Could I write a class for my additional properties and some how place a pointer to an instance of the class in the .tag property ?
0
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
Yes you can.
0
 
LVL 1

Author Comment

by:Dodsworth
Comment Utility
But then I'd have to cast it to get at the properties right?
0
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
Yes because it would be stored as type object.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now