C# Operator '/' cannot be applied to operands of type 'method group' and 'int -


error occurs on line:

xpoint int32

randomsize int

xpoint = picturebox1.width / 2 - randomsize -  objectpos.getoffset / 10 * randomsize / 192;          

here's function(s) apparently cause it, can explain me why?

        public float getsector()         {             return (float)math.floor(x / 192 + 135);         }          public int32 getoffset ()         {             return (int32)((x / 192) - getsector() + 135) * 192 * 10;         } 

getoffset method, , must called.

objectpos.getoffset() / 10 

(note parens after getoffset)

without parens, referring function, not value.

if intend getoffset property, need put in get , set keywords.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -