Thank you sir. The following is what I ended up using and it works great.
SetStatus d = new SetStatus( (string myText) =>
{
// Do some work
});
this.Invoke(d, new object[] { _text });
Thank you sir. The following is what I ended up using and it works great.
SetStatus d = new SetStatus( (string myText) =>
{
// Do some work
});
this.Invoke(d, new object[] { _text });
I assure you it's not homework. I've been programming (promoted from drafting) for about three years. I started in VB.Net and am now trying to convert to C#. That doesn't seem to work. How can I cast a lambda expression? Thanks for the auto translate idea. I ran the code through a couple and none seem to work. Thanks for your help.
What is the C# equivalent to the following VB.NET code?
Delegate Sub SetStatus(ByVal Text As String)
Private Sub SetStatusStrip(ByVal Text As String)
Dim d As New SetStatus(Sub()
' Do some work.
End Sub)
Me.Invoke(d, New Object() {Text})
End Sub
Hello, I'm not sure where the proper place to post this question, so I'll ask it here. I want to set up a class that has properties and sub-properties in VB.net 2008 Express. Class | 1st Prop | 2nd Prop Example: iClass.RFWN.OD and iClass.WF.Width My goal is to make a class library(.dll file) that can be added to a project, which I know how to do. What I'm unsure of is how to link one public property to another. Can all the properties and sub-properties be in one class object or do they need to be in their own? Any help at all would be greatly appreciated, whether it be a small code snippet or just a point in the right direction via an online article or tutorial. I'm fairly new at this, so please, talk down. Thank you, Eric.
Thank you for replying so quickly. I tried your suggestion and I still have the same problem. I am using vb.net express 2008. The blue squiggly line is under the first(opening) bracket.
Public Function Rating(ByVal iNPS As String, ByRef iRatings() As String) As String Select Case iNPS Case "1/2""" iRatings = {"150#", "300#"} 'This is the line where I get an error End Select End Function In the error list I get an "Expression Expected" error. I'm trying to return a string array so I can populate a combobox for a user. Any help would be much appreciated. Eric.
Hello, What practice is best if you are trying to save coping and pasting thousands of lines of reusable code. Currently I have all the code in a module. I have included an example. The problem I'm having is; I cannot retrieve any information from a calling sub in a form. I'm trying to have a combo box with the size listing and I want to retrieve a specific piece of information when selecting a size. Like the "HEIGHT". I have to use Class Library's for my projects to create dll files that will work with my 3D modeling program. I've read some about creating class objects but not sure about how to accomplish that or if it's really what I need to do. If someone could shed some light on my dilemma, I would really appreciate it. Module Module1 Public Function RMT(ByVal RMTSize As String, Optional ByRef WIDTH As Double = 0, Optional ByRef HEIGHT As Double = 0, Optional ByRef WALLTH As Double = 0, Optional ByRef OUTRAD As Double = 0) As Double Select Case RMTSize Case "3 x 2 x 3/16" WIDTH = 3.0 HEIGHT = 2.0 WALLTH = 0.1875 OUTRAD = 0.375 Case "3 x 2 x 1/4" WIDTH = 3.0 HEIGHT = 2.0 WALLTH = 0.25 OUTRAD = 0.5