Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Microsoft .Net
 Real-Time Graphics Tools for .Net (VB and C#)
 Iterating through ChartView's attached objects

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
soundar Posted - 18 Feb 2008 : 15:22:56
Is there a way to iterate through all objects that are attached to a ChartView object?

I want to be able to something like this:

For each x as system.object in chartVu.objects(?)
if not Trycast(x,RTScrollframe) is nothing then
dim fr as RTScrollFrame = ctype(x,RTScrollFrame)
fr.Rescaleframe....
end if
next
3   L A T E S T    R E P L I E S    (Newest First)
quinncurtis Posted - 19 Feb 2008 : 13:52:31
Having to constantly check the type of a an object in order to know what to do with it is not a good OOP programming technique, but that's up to you.

The array of chart objects added to the ChartView can be obtained by calling the ChartView's GetChartObjectsArrayList method. It returns a reference to the internal ArrayList used to store the objects. An ArrayList is .Net System.Collections object.

Dim cvobjarray As ArrayList = Me.GetChartObjectsArrayList()
Dim cvobj As GraphObj
Dim i As Integer

For i = 0 To cvobjarray.Count - 1
  cvobj = cvobjarray(i)
Next i
soundar Posted - 19 Feb 2008 : 13:21:46
I am using global arrays right now but I find it cumbersome to use global arrays for everything like process vars, scroll frames, axes, axes labels, colors, line styles etc and was wondering if there is an easier way. If I can iterate through the objects, then I can pass the chartview object itself between functions. This is especially useful if I control chart variables (scaling, color etc) from outside the user control (from the containing form). I have 3 or 4 applications that use the same user control with only slight different parameters.
quinncurtis Posted - 18 Feb 2008 : 17:39:16
Try and explain why do you want to do what you describe ? We can't image a scenario where this a good approach to getting access to the instance of ScrollFrame.

If you want access to a ScrollFrame that you create for a chart, just make it a variable global to the class. That way you won't have to go looking for it in the ChartView's list of objects. That's the way it is done in the ScrollApplicationUserControl1 example program.

Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07