C Visual Studio Windows Form You are to create the classic

C# Visual Studio - Windows Form

You are to create the classic game of Wheel of Fortune. Your application should consist of 3 players, underlines to represent letters in the puzzle, and the available letters. The initial screen should look something like:

Solution

Here is code that i reconfigured

vb Code:

Option Explicit

Private MaxCharacterNumber As Integer

Private txtLength As Integer

Private SpaceLeft As Integer

Private LeftSide As Integer, RightSide As Integer

Private k As Integer, tAdd As String, strText As String

Private Sub Command1_Click()

For k = 1 To 4

txtLine(k) = \"\"

lblLine(k) = \"\"

lblLetterCt(k) = \"\"

Next

End Sub

Private Sub Form_Load()

MaxCharacterNumber = -1

Command1_Click

End Sub

Private Sub LocateText(aLine As Integer)

strText = txtLine(aLine).Text

\'number of the character of the line selected

txtLength = Len(strText)

\'maximum character number

If txtLength > MaxCharacterNumber Then MaxCharacterNumber = txtLength

\'space left

SpaceLeft = 12 - MaxCharacterNumber

LeftSide = SpaceLeft / 2

tAdd = \"\"

For k = 1 To 4

strText = txtLine(k).Text

txtLength = Len(strText)

\'extra star for middle lines

If k = 2 Or k = 3 Then tAdd = \"*\"

If txtLength > 0 Then

RightSide = 12 - txtLength - LeftSide

lblLine(k) = tAdd & String(LeftSide, \"*\") & txtLine(k).Text & String(RightSide, \"*\") & tAdd

lblLetterCt(k) = txtLength

End If

Next

End Sub

Private Sub txtLine_KeyPress(Index As Integer, KeyAscii As Integer)

If KeyAscii = 13 Then Call LocateText(Index)

End Sub

i changed all elements to the control array to reduce to write code and to use For ..

C# Visual Studio - Windows Form You are to create the classic game of Wheel of Fortune. Your application should consist of 3 players, underlines to represent le
C# Visual Studio - Windows Form You are to create the classic game of Wheel of Fortune. Your application should consist of 3 players, underlines to represent le

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site