473,395 Members | 1,986 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to convert this C# code into VB 2005 code?

This should be easy, but I don't figure it out...

private void setInfoText(string text)
{
if (this.statusStrip1.InvokeRequired)
{
this.Invoke((MethodInvoker)delegate()
{
this.pnlInfo.Text = text;
});
}
else
{
this.pnlInfo.Text = text;
}
}

....should be about...

Private Sub SetInfoText(text As String)
If (Me.StatusStrip1.InvokeRequired) Then
Me.Invoke((MethodInvoker)delegate() <-- ???
Me.pnlInfo.Text = text
)
Else
Me.pnlInfo.Text = text
End If
End Sub
--

Thanks in advance!

Mika
Dec 12 '07 #1
2 1262
Mika,

This website has helped me in the past, as i'm not to great with C#.
Its a free site.

http://www.carlosag.net/Tools/CodeTr...r/Default.aspx
Dec 12 '07 #2
"Mika M" <mi*********************@kolumbus.fischrieb:
This should be easy, but I don't figure it out...

private void setInfoText(string text)
{
if (this.statusStrip1.InvokeRequired)
{
this.Invoke((MethodInvoker)delegate()
{
this.pnlInfo.Text = text;
});
}
else
{
this.pnlInfo.Text = text;
}
}

...should be about...

Private Sub SetInfoText(text As String)
If (Me.StatusStrip1.InvokeRequired) Then
Me.Invoke((MethodInvoker)delegate() <-- ???
Me.pnlInfo.Text = text
)
Else
Me.pnlInfo.Text = text
End If
End Sub
--
Note that VB does not support real anonymous methods, it only supports
anonymous Lambda expressions. Nevertheless, in your case you can pass a
delegate to 'SetInfoText' to the 'Invoke' method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Dec 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Franck | last post by:
Hi, 'm gettin mad about date conversion. Here is the point. Got and add-in for Excel which call functions from a web service (on a remote server) The remote server has regional settings...
6
by: Tim Cartwright | last post by:
I have a page that has the login control on it, nothing else. This page inherits from a master page, neither page has any code in it. This page works perfectly when running on the WebDev debug web...
2
by: yxq | last post by:
Hello, I found there are some date formats in the email header, for example: Fri, 23 Sep 2005 08:51:56 +0800 Sat, 17 Sep 2005 09:08:07 Wed Oct 19 13:40:23 2005 19 Oct 2005 13:40:23 +0000...
1
by: David Herbst | last post by:
I have a solution that contains one main web project, ten sub web projects and a controls library project all in a single web application. I followed the steps in the following MS KB: How To...
8
by: Stephen | last post by:
Hi, has anyone converted code from VS 2005 to VS 2003? Thanks, Stephen
2
by: Chris Davoli | last post by:
I have written a web site (with other class projects) in VS.net 2003 (VB.Net). What does it take to convert to Visual Studio.Net 2005? Can the 2003 project just be opened up in 2005? Will that...
1
by: johnlim20088 | last post by:
Hi, Currently I have 6 web projects located in Visual Source Safe 6.0, as usual, everytime I will open solution file located in my local computer, connected to source safe, then check out/check in...
2
by: Galil | last post by:
I have a subroutine I need to convert from vb.net 2005 to visual C++ ( .net 2005) The function only allows specific characters to be typed into a textbox. the backspace and 0 -9. Private Sub...
2
by: trondhuso | last post by:
Hi group, I've found some code that I want to use in a project that I am working on, but the code is for c# .net and not 2003 or 2005 that I have available. In this code the program yells on...
1
by: lds | last post by:
I have Visual Studio 2005 Professional Edition installed with Service Pack 1. I have several solutions and projects that I have migrated from Visual Studio 2003 to 2005. In most cases the changes...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.