I've run across the following line in a VB6 application.
mobjParentWrkBk.ExcelWorkBook.Application.Selection.Insert Shift:=xlToRight
Unfortunately Google and other search engines have not been very useful as they seem to omit the := part.
What would be a C# equivalent?
This is Visual Basic syntax for optional named parameters. The Insert
function has a parameter named Shift
, which is being specified.
C#, as far as I know, doesn't have an equivalent for optional named parameters. Instead, you'd need to call the Insert
method, specifying Type.Missing
for all parameters other than Shift
.
See also the following StackOverflow question: VB.NET := Operator
UPDATE (2008-10-29):
C# 4.0 is set to introduce optional and named parameters. See this blog entry on codebetter.com.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With