[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1810
  • Last Modified:

why RectangleF.op_Implicit ?

RectangleF.op_Implicit(rect) seems to give the same result as (RectangleF)rect, where rect is of type Rectangle. If so, why is .op_Implicit recommended in most of the g.DrawString(.) examples I have seen? I'm asking because I get a compile error using .op_Implicit under Clr 2.0 (but not Clr 1.1) Error is
"cannot explicitly call operator or accessor"      

0
odenlou
Asked:
odenlou
1 Solution
 
JimBrandleyCommented:
If you are using c#, all you need in 2.0 is:
RectangleF frect = rect;

The conversion is implicit.

If you are in vb, in 2.0:
Dim frect As RectangleF = RectangleF.op_Implicit(rect)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now