Solved

Circle Class

Posted on 2013-11-06
7
183 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
ID: 39628092
Just create a class which uses Ellipse class to draw itself?
0
 
LVL 1

Author Comment

by:Dodsworth
ID: 39639353
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
ID: 39639945
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:Dodsworth
ID: 39641285
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
ID: 39642981
Yes you can.
0
 
LVL 1

Author Comment

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

Expert Comment

by:CodeCruiser
ID: 39646270
Yes because it would be stored as type object.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 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

24 Experts available now in Live!

Get 1:1 Help Now