Change shapestyle using VB.Net

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
newbie
Newbie
Newbie
Posts: 11
Joined: Tue Apr 11, 2006 12:00 am
Contact:

Change shapestyle using VB.Net

Post by newbie » Tue Apr 11, 2006 6:06 pm

Is there an VB.net equivalent for the following C# post? Using CType causes a runtime crash.

private void Button1_Click(object sender, System.EventArgs e)
{
(WebChart1.Chart.Series[0] as Steema.TeeChart.Styles.Shape).Style = Steema.TeeChart.Styles.ShapeStyles.Rectangle;
}

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Apr 12, 2006 8:19 am

Hello,

It works fine for me here using:

Code: Select all

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        CType(WebChart1.Chart.Series(0), Steema.TeeChart.Styles.Shape).Style = Steema.TeeChart.Styles.ShapeStyles.Rectangle
    End Sub
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

newbie
Newbie
Newbie
Posts: 11
Joined: Tue Apr 11, 2006 12:00 am
Contact:

Post by newbie » Wed Apr 12, 2006 5:18 pm

Thanks for the quick reply. I tried that, but the error I'm getting at run time is:

Unable to to cast object of type 'Steema.TeeChart.Styles.Points' to type 'Steema.TeeChart.Styles.Shape'

I'm adding the points like this:

defectPoints(i) = New Steema.TeeChart.Styles.Points(tchart.Chart)

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Apr 13, 2006 8:13 am

Hi newbie,

What you are doing here is adding point series. If you want to change its pointer style you need to do something like:

Code: Select all

CType(WebChart1.Chart.Series(1), Steema.TeeChart.Styles.Points).Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

newbie
Newbie
Newbie
Posts: 11
Joined: Tue Apr 11, 2006 12:00 am
Contact:

Post by newbie » Thu Apr 13, 2006 5:41 pm

Works great. Thanks!

Post Reply