473,395 Members | 1,702 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.

Convert code line to VB.NET

Hello,

I am having problems in converting the following code line to VB.NET:

Control[] list = MyFun(myControl, delegate(Control ctl) { ctl.ID ==
"MyControl"; });

Could someone please help me out?

Thanks,

Miguel
Jan 30 '08 #1
2 945
Hi,

"shapper" <md*****@gmail.comwrote in message
news:0b**********************************@y5g2000h sf.googlegroups.com...
Hello,

I am having problems in converting the following code line to VB.NET:

Control[] list = MyFun(myControl, delegate(Control ctl) { ctl.ID ==
"MyControl"; });

Could someone please help me out?
I thought I answered one of these earlier oday. Anyway, at a guess:

Dim list As Control() = MyFun(myControl, Function(ctl As Control) ctl.Id =
"MyControl")

Jan 30 '08 #2
VB.NET doesn't support anonymous methods (AFAIK anyway) so you'll have to
make a separate function for the delegate. Something like this:

Dim list As Control() = MyFun(myControl, AddressOf MyOtherFun)
....
Private Sub MyOtherFun(ByVal ctl As Control)
ctl.ID = "MyControl"
End Sub
"shapper" <md*****@gmail.comwrote in message
news:0b**********************************@y5g2000h sf.googlegroups.com...
Hello,

I am having problems in converting the following code line to VB.NET:

Control[] list = MyFun(myControl, delegate(Control ctl) { ctl.ID ==
"MyControl"; });

Could someone please help me out?

Thanks,

Miguel

Jan 30 '08 #3

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

Similar topics

4
by: Jason Huang | last post by:
Hi, I would like to convert the following Visual Basic code to C#, does someone has free tool to convert it? Function PreConnect() As Boolean Dim strDSN$, strUidPwd$, strDatabase$,...
12
by: Brian Henry | last post by:
first question... I have a flat file which unfortinuatly has columns seperated by nulls instead of spaces (a higher up company created it this way for us) is there anyway to do a readline with this...
65
by: kyle.tk | last post by:
I am trying to write a function to convert an ipv4 address that is held in the string char *ip to its long value equivalent. Here is what I have right now, but I can't seem to get it to work. ...
0
by: Mark Parter | last post by:
I'm trying convert an XML Schema (http://www.elframework.org/projects/xcri/efc_r1.0.xsd/view) to a VB.Net class using the XSD tool provided with the .NET 2 SDK. However, it's failing to generate...
14
by: John Smith | last post by:
Can someone convert from C# into VB this line for me: if (c is System.Web.UI.HtmlControls.HtmlForm)
10
by: Gary | last post by:
Hello, Anyone know how to do the following in c# - using inline codeblocks? <% If Request.Form("Name") = "Gary" Then %> <asp:RequiredFieldValidator ID="GarysValidation" ErrorMessage="Gary,...
9
by: olivercfc | last post by:
Hello All, I have a text file in the following format < line 1 line 2 line 3 line < 4 line > 5
5
by: Dave Bootsma | last post by:
I have an application where I want to redraw a polygon from points I retrieve from a file. The file is read with streamreader line by line each line contains the points for each polygon. Below is...
19
by: est | last post by:
From python manual str( ) Return a string containing a nicely printable representation of an object. For strings, this returns the string itself. The difference with repr(object) is that...
14
by: rtillmore | last post by:
Hello, I did a quick google search and nothing that was returned is quite what I am looking for. I have a 200 character hexadecimal string that I need to convert into a 100 character string. ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.