473,399 Members | 4,177 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,399 software developers and data experts.

Equivelant With - End with

Ant
Hi there,
Is there an equivelant in C# to the VB:

With controlName
.property = X
.Method
End with

Thanks very much in advance
Ant
Nov 17 '05 #1
3 1393
With operator is VB specific.

There is no equivalent in c#.

- Moty -

"Ant" <An*@discussions.microsoft.com> wrote in message
news:42**********************************@microsof t.com...
Hi there,
Is there an equivelant in C# to the VB:

With controlName
.property = X
.Method
End with

Thanks very much in advance
Ant

Nov 17 '05 #2
Ant <An*@discussions.microsoft.com> wrote:
Is there an equivelant in C# to the VB:

With controlName
.property = X
.Method
End with


No.

See http://www.pobox.com/~skeet/csharp/faq/#vb.with

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #3
=?Utf-8?B?QW50?= <An*@discussions.microsoft.com> wrote in news:42452A2A-AC20-49B6-8D00-
81**********@microsoft.com:
Hi there,
Is there an equivelant in C# to the VB:

With controlName
.property = X
.Method
End with


As others answered, no. But if you have a LOT of properties to set you can "shortcut" like this:

{
ControlType x = controlName;
x.Property = xx;
x.Method();
}

Note the use of { and }
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Develop ASP.NET applications easier and in less time:
http://www.atozed.com/IntraWeb/
Nov 17 '05 #4

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

Similar topics

1
by: Richard | last post by:
What is the equivelant thing in php for the javascript onclick event? Specifically, when a visitor clicks on an image.
3
by: Alex Hunsley | last post by:
Pretty simple seeming question, but can't find answer via google or docs... I am using urllib2 as follows: handle = urlopen(req, postdata) # and URL to return a handle on ... print...
0
by: hsifelbmur | last post by:
does anyone know a product equivelant to MS SQL Server Reporting Services, but for MySQL or PostGreSQL?
2
by: Chris LaJoie | last post by:
I'm converting some APIs to C# and I'm wondering what the equivelant of a DWORD is. I'm thinking it's a uint, but I'm uncertiain. Can anyone confirm that? Chris
5
by: Torben S. Petersen | last post by:
Hi, I am currently trying to re-write some VC++ code into C# but are having problems finding a way to convert the C++ memcpy into C#. The following is part of the code: ...
1
by: Shawn B. | last post by:
Greetings, What is the C# equivelant of the VB.NET CharW() function? I've seen many replies to a similar post but I've never seen the answer that solves my problem. I need to get the Unicode...
2
by: ad | last post by:
There are InStr in VB What is the C# equivelant of the function InStr in VB? ---------------------------------------------------------------------------- ------------------ SearchString...
1
by: Tim Kelley | last post by:
Is there an equivelant to the vb6 app.name in c#? Thanks
47
by: Nathan Sokalski | last post by:
VB.NET has a function, Asc(), that gets the Ascii value of a character. I am attempting to find an equivelant function for C#. Can somebody help me here? -- Nathan Sokalski njsokalski@hotmail.com...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.