클래스에서 멤버 함수를 만들었습니다. 이후에이 멤버 함수의 결과로 설정된 멤버 값을 만들고 싶습니다.F # 멤버 함수를 기반으로 멤버 값을 만듭니다.
type MyType() =
member this.drawFilledPlanet(xCoord:int, yCoord:int, pWidth:int, pHeight:int, color) =
let brush = new System.Drawing.SolidBrush(color)
this.window.Paint.Add(fun e ->
e.Graphics.FillEllipse(brush, xCoord, yCoord, pWidth, pHeight))
member val theSun = drawFilledPlanet(350,350,100,100, this.yellow)
나는 drawFilledPlanet
가 정의되지 않는 오류가 발생하고있다.
누군가가 내게 어떤 소식을 전할 수 있습니까?
'drawFilledPlanet' 앞에'this.'가 없습니다. –
아니, 아니야 – Nulle
네, 그렇습니다 ..... –