Visual Basic에서 작업하고 있습니다. 함수를 통해 레이블에 정수를 전달하지만 레이블에 System.Int32[]
이라는 값이 표시되고 '완료'를 클릭하면 저장되고 저장 파일에 올바른 숫자가 표시됩니다. 당신이 극명하게 될 것이다 나에게 몇 가지 조언을주고 그것을 도울 수 있다면 당신은 당신이 가지고 일부 코딩 오류를 지적 할 것이다 Option Strict On를 사용하는 경우, 당신에게Visual Basic의 텍스트 상자에 System.Int32 []가 표시됩니다.
'function for adding 1 point to your selected level.
Private Function SkillPoints(IntSkill)
'checks if you have enough level points
If IntLevel > 0 Then
'adds 1 point to the selected skill and minuses 1 from Intlevel
Intskillpoints(IntSkill) += 1
IntLevel -= 1
LblLvlPoints.Text = IntLevel
Else
MsgBox("You have run out of skill points.")
End If
' returns the value to be shown in the label
Return Intskillpoints
End Function
Private Sub BtnAtkPlus_Click(sender As Object, e As EventArgs) Handles BtnAtkPlus.Click
'when you click the button it sets the lbl to the result of the function.
LblAttackPoints.Text = SkillPoints(0).ToString
End Sub
아마도 대신 Intskillpoints (IntSkill)를 보내시겠습니까? –
당신은 정말로 Option Strict –
@MikeChristensen이 별도의 답변으로 답변을 게시하도록 설정해야합니다 :) –