-
December 14th, 2010, 09:59 AM
#1
Calling methods on unnamed objects
Hello,
We are building a graphing application in which we define the different components of the form as user controls.
We have defined a number of series on the graph such as bar, candlesticks, line etc. and at a time, only one series is visible on the graph. The user selects a radio button and based on the selection, one of the series is made visible and the others are disabled.
The problem we are facing is that we are unable to access the method defined for disabling/enabling a series in the class for creating the chart as there is no way to reference the object created at run-time for the chart.
We are coding in Visual Studio.
What can be done to call methods in run-time objects which cannot be referenced?
Thanks.
-
December 14th, 2010, 12:25 PM
#2
Re: Calling methods on unnamed objects
if you mean late binding then Using Type dynamic (C# Programming Guide) might help you
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
-
December 14th, 2010, 01:19 PM
#3
Re: Calling methods on unnamed objects
The problem we are facing is that we are unable to access the method defined for disabling/enabling a series in the class for creating the chart as there is no way to reference the object created at run-time for the chart.
Huh? Of course there is. When you create it, save it as an instance level variable.
-
December 15th, 2010, 10:25 PM
#4
Re: Calling methods on unnamed objects
When you create an object dont you create it like so:
Object obj = new Object(); ?
You would be able to reference this object by
using the name obj example obj.Dispose();
-
December 16th, 2010, 02:52 AM
#5
Re: Calling methods on unnamed objects
You can create instance of usercontrols and then access the public method of those usercontrols.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|