Click here to Skip to main content
15,890,506 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: File paths and language issue Pin
Jochen Arndt5-Feb-18 3:00
professionalJochen Arndt5-Feb-18 3:00 
GeneralRe: File paths and language issue Pin
Member 136226275-Feb-18 3:25
Member 136226275-Feb-18 3:25 
GeneralRe: File paths and language issue Pin
Jochen Arndt5-Feb-18 3:51
professionalJochen Arndt5-Feb-18 3:51 
QuestionListbox maximum? Pin
MallardsReach2-Feb-18 7:32
MallardsReach2-Feb-18 7:32 
AnswerRe: Listbox maximum? Pin
Dave Kreskowiak2-Feb-18 7:54
mveDave Kreskowiak2-Feb-18 7:54 
GeneralRe: Listbox maximum? Pin
MallardsReach2-Feb-18 20:21
MallardsReach2-Feb-18 20:21 
GeneralRe: Listbox maximum? Pin
Dave Kreskowiak3-Feb-18 3:39
mveDave Kreskowiak3-Feb-18 3:39 
GeneralRe: Listbox maximum? Pin
MallardsReach3-Feb-18 4:42
MallardsReach3-Feb-18 4:42 
Hi Dave,
I only ever code for myself, it's a hobby nothing more, this program is for the bowling club that I attend on Wednesday nights, we have 4 mats and when your game is finished the names of the 4 players go back in to the pool and the next 4 players use the mat you've just left.
Below is the complete code, not that you need it but you can see what I did, no comments as it's only for me to play with.

VB
Public Class Form1


    Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyDown
        If e.KeyCode = Keys.Enter Then
            Static Fillup = 1
            Select Case Fillup
                Case 1
                    LstMat1.Items.Add(TextBox1.Text)
                    TextBox1.Text = String.Empty
                    If LstMat1.Items.Count = 4 Then
                        Fillup = 2
                    End If
                Case 2
                    LstMat2.Items.Add(TextBox1.Text)
                    TextBox1.Text = String.Empty
                    If LstMat2.Items.Count = 4 Then
                        Fillup = 3
                    End If
                Case 3
                    LstMat3.Items.Add(TextBox1.Text)
                    TextBox1.Text = String.Empty
                    If LstMat3.Items.Count = 4 Then
                        Fillup = 4
                    End If
                Case 4
                    LstMat4.Items.Add(TextBox1.Text)
                    TextBox1.Text = String.Empty
                    If LstMat4.Items.Count = 4 Then
                        Fillup = 5
                    End If
                Case 5
                    LstNames.Items.Add(TextBox1.Text)
                    TextBox1.Text = String.Empty
            End Select
        End If
    End Sub

    Private Sub BtnMat1_Click(sender As Object, e As EventArgs) Handles BtnMat1.Click
        Static num = 3
        For clearLb = 0 To 3
            LstNames.Items.Add(LstMat1.Items(num))
            LstMat1.Items.Remove(LstMat1.Items(num))
            num = num - 1
            If num = -1 Then
                For fillLb = 0 To 3
                    LstMat1.Items.Insert(0, LstNames.Items(0))
                    LstNames.Items.Remove(LstNames.Items(0))
                    num = 3
                Next
            End If
        Next
    End Sub

    Private Sub BtnMat2_Click(sender As Object, e As EventArgs) Handles BtnMat2.Click
        Static num = 3
        For clearLb = 0 To 3
            LstNames.Items.Add(LstMat2.Items(num))
            LstMat2.Items.Remove(LstMat2.Items(num))
            num = num - 1
            If num = -1 Then
                For fillLb = 0 To 3
                    LstMat2.Items.Insert(0, LstNames.Items(0))
                    LstNames.Items.Remove(LstNames.Items(0))
                    num = 3
                Next
            End If
        Next
    End Sub

    Private Sub BtnMat3_Click(sender As Object, e As EventArgs) Handles BtnMat3.Click
        Static num = 3
        For clearLb = 0 To 3
            LstNames.Items.Add(LstMat3.Items(num))
            LstMat3.Items.Remove(LstMat3.Items(num))
            num = num - 1
            If num = -1 Then
                For fillLb = 0 To 3
                    LstMat3.Items.Insert(0, LstNames.Items(0))
                    LstNames.Items.Remove(LstNames.Items(0))
                    num = 3
                Next
            End If
        Next
    End Sub

    Private Sub BtnMat4_Click(sender As Object, e As EventArgs) Handles BtnMat4.Click
        Static num = 3
        For clearLb = 0 To 3
            LstNames.Items.Add(LstMat4.Items(num))
            LstMat4.Items.Remove(LstMat4.Items(num))
            num = num - 1
            If num = -1 Then
                For fillLb = 0 To 3
                    LstMat4.Items.Insert(0, LstNames.Items(0))
                    LstNames.Items.Remove(LstNames.Items(0))
                    num = 3
                Next
            End If
        Next
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        LstNames.Items.Remove(LstNames.SelectedItem.ToString)
    End Sub
End Class

SuggestionRe: Listbox maximum? Pin
CHill609-Feb-18 1:55
mveCHill609-Feb-18 1:55 
AnswerRe: Listbox maximum? Pin
Eddy Vluggen2-Feb-18 9:29
professionalEddy Vluggen2-Feb-18 9:29 
GeneralRe: Listbox maximum? Pin
MallardsReach2-Feb-18 20:37
MallardsReach2-Feb-18 20:37 
GeneralRe: Listbox maximum? Pin
Eddy Vluggen3-Feb-18 4:41
professionalEddy Vluggen3-Feb-18 4:41 
GeneralRe: Listbox maximum? Pin
MallardsReach3-Feb-18 4:44
MallardsReach3-Feb-18 4:44 
GeneralRe: Listbox maximum? Pin
Eddy Vluggen3-Feb-18 4:53
professionalEddy Vluggen3-Feb-18 4:53 
GeneralRe: Listbox maximum? Pin
MallardsReach3-Feb-18 4:57
MallardsReach3-Feb-18 4:57 
GeneralMake setup file Pin
Member 1362262729-Jan-18 10:13
Member 1362262729-Jan-18 10:13 
GeneralRe: Make setup file Pin
Eddy Vluggen30-Jan-18 0:52
professionalEddy Vluggen30-Jan-18 0:52 
GeneralRe: Make setup file Pin
Member 1362262730-Jan-18 11:56
Member 1362262730-Jan-18 11:56 
GeneralRe: Make setup file Pin
Eddy Vluggen31-Jan-18 1:26
professionalEddy Vluggen31-Jan-18 1:26 
GeneralRe: Make setup file Pin
Member 1362262731-Jan-18 1:37
Member 1362262731-Jan-18 1:37 
GeneralRe: Make setup file Pin
Eddy Vluggen31-Jan-18 1:48
professionalEddy Vluggen31-Jan-18 1:48 
GeneralRe: Make setup file Pin
Member 1362262731-Jan-18 2:05
Member 1362262731-Jan-18 2:05 
GeneralRe: Make setup file Pin
Eddy Vluggen31-Jan-18 2:37
professionalEddy Vluggen31-Jan-18 2:37 
GeneralRe: Make setup file Pin
Member 136226274-Feb-18 20:59
Member 136226274-Feb-18 20:59 
GeneralRe: Make setup file Pin
Eddy Vluggen5-Feb-18 1:17
professionalEddy Vluggen5-Feb-18 1:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.