[c#]回傳型態為物件,回傳值為null

看板Programming作者時間18年前 (2006/12/17 14:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
public RectangleF GetCollisionMBR() { //... return bCollisionMBRExists ? rfCollisionBoundingBox : null; } ↑ ↑ bool RectangleF 跑出錯誤 Type of conditional expression cannot be determined because there is no implicit conversion between 'System.Drawing.RectangleF' and '<null>' 請問這裡要怎麼改? 感謝大德! -- ╮═╦═╮╮ ╭╭═╮╭═╮╮═╦═╮╭═╮Don't hold me with your eyes. ║ ║ ║║ ║║ ║║ ║║ ║ ║╠═╯The light in them I cannot see. ║ ║ ║╰═╣╰═╣╰═╰║ ║ ║╰═╯No need to blind me. ▂◣ There's this darkness where I walk. ▃▄▅▆▇╰═╯╰═╯▇▆▅▆▇████▆▇▅◣ˍ ~Playing My Game~ -- ︵︵ █▔◣ █▔█ █▔▔ █▔█ █▆▉ █ █▔█ █◣█ █▔ █◣︵︵ █ █ █▁◤ █▁▁ █▁█ ▉▉▉ █ █▁█ █◥█ █ █ 夢之大地 逼逼ㄟ四 █▁◤ █ █ █▁▁ █ █ ▉▉▉ █▁ █ █ █ █ █▁◤ ※ Origin: <bbs.ccns.ncku.edu.tw> ◆ From: 210.240.182.67
文章代碼(AID): #15XEHb00 (Programming)
文章代碼(AID): #15XEHb00 (Programming)