이 섹션에서는 컴퓨터의 승리, 사용자의 승리 또는 동점을 알아 내려고합니다. 누구든지 내 코드를 편집 할 수 있습니까? 나는 내 능력의 끝을 막 봤다. 나는 물건을 사용해야한다고 생각하니? 그러나 나는 나의 코드를 편집 해 왔으며 여기에서 더 악화된다. 누구든지 나를 도울 수 있다면 정말 감사 할 것입니다 !!VB.net .. 개체를 사용하는 동안 오류가 발생 했습니까?
' Card shuffling and dealing application.
Public Class DeckOfCardsTest
Dim userwin As Integer
Dim compwin As Integer
Dim ties As Integer
Private deck As New DeckOfCards() ' create the deck of cards
' shuffle the deck when user clicks the Shuffle Button
Private Sub shuffleButton_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles shuffleButton.Click
deck.Shuffle() ' shuffles the deck
card1PictureBox.Image = Nothing ' clear image
card2PictureBox.Image = Nothing ' clear image
dealButton.Enabled = True ' allow user to click the Deal Button
MessageBox.Show("Deck is shuffled")
End Sub ' shuffleButton_Click
Private Sub dealButton_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles dealButton.Click
End Sub ' dealButton_Click
' return an image for the Card argument
Private Function GetCardImage(ByVal card As Card) As Image
If card IsNot Nothing Then
' retrieve specific card image from resources
Dim pictureResource = My.Resources.ResourceManager.GetObject(
card.ToString().Replace(" ", ""))
Return CType(pictureResource, Image) ' return Image
Else
dealButton.Enabled = False ' disable the Deal Button
Return Nothing ' no more cards
End If
End Function ' GetCardImage
End Class ' DeckOfCardsTest
이 숙제입니까? – stevehipwell
특정 문제에 대해보다 구체적으로 설명하고 문제를 해결하는 가장 작은 금액으로 코드를 트리밍 할 수 있습니까? 그렇게하면 원인을 알 수 있습니다. –
'cardXPictureBox'는 PictureBox 컨트롤에서 파생 되었습니까? – ajakblackgoat