How to convert the c# to vb for this statement?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
sherlyn
Newbie
Newbie
Posts: 8
Joined: Tue Sep 19, 2006 12:00 am

How to convert the c# to vb for this statement?

Post by sherlyn » Wed Nov 15, 2006 3:39 am

Hi,

I'm refering to Tutorial 10 - Walkthrough ASP.NET example and is trying to code in VB.
Can someone help me to convert this C# statement to VB?

zoomedState=((Steema.TeeChart.Tools.ZoomTool)wChart.Chart.Tools[0]).SetCurrentZoom(Request,zoomedState);

I try code:
Dim zoomTool As Steema.TeeChart.Tools.ZoomTool = New Steema.TeeChart.Tools.ZoomTool
zoomTool = wChart.Chart.Tools(0)

but failed.

sherlyn
Newbie
Newbie
Posts: 8
Joined: Tue Sep 19, 2006 12:00 am

Post by sherlyn » Wed Nov 15, 2006 5:30 am

I tried this code,

zoomedState = CType(wChart.Chart.Tools(0), Steema.TeeChart.Tools.ZoomTool).SetCurrentZoom(Request, zoomedState)

but still "the specified cast is not valid"

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 Nov 15, 2006 9:42 am

Hi sherlyn,

The VB.NET equivalent of the CheckZoom method is this:

Code: Select all

    Private Sub CheckZoom(ByVal wChart As WebChart)
        Dim zoomedState As ArrayList = CType(Session(wChart.ID + "Zoomed"), ArrayList)
        zoomedState = (CType(wChart.Chart.Tools(0), Steema.TeeChart.Tools.ZoomTool)).SetCurrentZoom(Request, zoomedState)
        If zoomedState Is Nothing Then
            Session.Remove(wChart.ID + "Zoomed")
        Else
            Session.Add(wChart.ID + "Zoomed", zoomedState)
        End If
    End Sub
To help you translate C# to VB.NET code and viceversa you can use one those tools:

http://carlosag.net/Tools/CodeTranslator/Default.aspx
http://www.kamalpatel.net/ConvertCSharp2VB.aspx
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

Post Reply