Solved

Convert to VB.net

Posted on 2014-03-18
3
291 Views
Last Modified: 2014-03-18
I'm trying to convert some C# code to VB.net, but the control in question is from the WP Toolkit and has no intellisense to help me work out what is happening.  I'm guessing that it's an event handler but I don't know where s1 comes from.  Can someone VBize it please?

messageBox.Dismissed += (s1, e1) =>
    {
        switch (e1.Result)

Open in new window

0
Comment
Question by:Dodsworth
  • 2
3 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 39936975
Please provide the delegate definition for the Dismissed property.
0
 
LVL 1

Author Comment

by:Dodsworth
ID: 39937324
There doesn't appear to be one.  But I found this in the object browser..

Public Event Dismissed(sender As Object, e As Microsoft.Phone.Controls.DismissedEventArgs)
Member of Microsoft.Phone.Controls.CustomMessageBox
0
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39937436
That's what I was after  = )

I don't work in VB often enough to remember all of the intricacies of implicit delegates, but hopefully this is an accurate translation. You may be able to nix the "ByVal ... As XXX" parts and just leave the variable names.

AddHandler messageBox.Dismissed, Function (ByVal sender As Object, ByVal e As EventArgs)
                                     Select Case e1.Result
                                         Case ...
                                     End Select
                                 End Function

Open in new window

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now