Solved

C# to vb.net

Posted on 2012-03-23
5
595 Views
Last Modified: 2012-04-02
Could somebody translate this to vb.net..

 Action action1 = () =>  this.BeginStoryboard((Storyboard)this.FindResource("BlinkStoryboardFedListBox"));
                Dispatcher.BeginInvoke(action1);
                Action action = () => CustomPaging((int)PagingMode.Next);
                Dispatcher.BeginInvoke(action);
                _timernextitem.Start();


 Action action1 = () => this.BeginStoryboard((Storyboard)this.FindResource("BlinkStoryboardSecondImageFed"));
            Dispatcher.BeginInvoke(action1);
            Action action = () => BindToSecondImages(lstimgpath);
            Dispatcher.BeginInvoke(action);
            _timerforsecimg.Start();
0
Comment
Question by:jamppi
5 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 37758117
Dim action1 As Action = Function() Me.BeginStoryboard(DirectCast(Me.FindResource("BlinkStoryboardFedListBox"), Storyboard))
Dispatcher.BeginInvoke(action1)
Dim action As Action = Function() CustomPaging(CInt(PagingMode.[Next]))
Dispatcher.BeginInvoke(action)
_timernextitem.Start()


Dim action1 As Action = Function() Me.BeginStoryboard(DirectCast(Me.FindResource("BlinkStoryboardSecondImageFed"), Storyboard))
Dispatcher.BeginInvoke(action1)
Dim action As Action = Function() BindToSecondImages(lstimgpath)
Dispatcher.BeginInvoke(action)
_timerforsecimg.Start()

Open in new window


http://www.developerfusion.com/tools/convert/csharp-to-vb/
0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 37758118
Dim action1 As Action = Function() Me.BeginStoryboard(DirectCast(Me.FindResource("BlinkStoryboardFedListBox"), Storyboard))
Dispatcher.BeginInvoke(action1)
Dim action As Action = Function() CustomPaging(CInt(PagingMode.[Next]))
Dispatcher.BeginInvoke(action)
_timernextitem.Start()


Dim action1 As Action = Function() Me.BeginStoryboard(DirectCast(Me.FindResource("BlinkStoryboardSecondImageFed"), Storyboard))
Dispatcher.BeginInvoke(action1)
Dim action As Action = Function() BindToSecondImages(lstimgpath)
Dispatcher.BeginInvoke(action)
_timerforsecimg.Start()

Open in new window


http://converter.telerik.com/
0
 

Author Comment

by:jamppi
ID: 37758175
tried that but i get,   'Expression does not produce a Value'
0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 37758385
I *think* but not sure you can do each of them like this:

Public Function() 
Dim action As Action  
BindToSecondImages(lstimgpath)
Dispatcher.BeginInvoke(action)
_timerforsecimg.Start()

Return action 
End Function

Open in new window

0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 250 total points
ID: 37758521
Use the keyword Sub instead of Function in the above solutions. Action corresponds to a function with a void return. The VB equivalent of a function that returns void is a Sub.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

776 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