如何在第一个列表框中输入7个数字后输入切换到第二个列表框? [英] How to get input to switch to a second listbox after 7 numbers are entered in the first listbox?

查看:92
本文介绍了如何在第一个列表框中输入7个数字后输入切换到第二个列表框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!所以我一直在为学校做这项任务,我有点卡住了。我应该创建这个表格来计算员工发运的平均单位。我有三个不同的员工,所以三个不同的列表框接受数据,但只有一个
输入文本框。该表单应该只接受第一个列表框中的7个数字,然后移动到第二个列表框,在那里获得7个数字,然后转到第三个。但我不知道怎么做




我试过

Hi! So I've been working on this assignment for school and I'm slightly stuck. I'm supposed to create this form to calculate average units shipped by employees. I have three different employees so three different listboxes to accept the data but only one input textbox. The form is supposed to only accept 7 numbers in the first listbox before moving onto the second listbox, getting 7 numbers there, then going to the third. But I don't know how to do that

I've tried











1 昏暗 学生(6) 正如 整数

推荐答案

您好

无论您做什么,请勿发布代码行号,或将代码作为图片发布。这两个都使复制粘贴变得太难,因此可能不会引起那些你要求帮助的人的兴趣。使用代码块(如此)代码。

Whatever you do, DO NOT post code line numbers, or, post code as an Image. Both of those make it too hard to copy paste and so will likely not get much interest from those you ask to help. Use a Code Block (like this) for code.

*

这是一种方式(有很多种可能性) )

Here is one way (of many possibilities)

' Form1 with Button1, TextBox1
' and 3 ListBoxesn(1,2,3)
Option Strict On
Option Explicit On
Public Class Form1
  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim tb As String = Trim(TextBox1.Text)
    If tb.Length > 0 Then
      Select Case ListBox1.Items.Count
        Case < 7
          ListBox1.Items.Add(tb)
        Case Else
          Select Case ListBox2.Items.Count
            Case < 7
              ListBox2.Items.Add(tb)
            Case Else
              Select Case ListBox3.Items.Count
                Case < 7
                  ListBox3.Items.Add(tb)
                Case Else
                  MessageBox.Show("Sorry-mall full up!")
              End Select
          End Select
      End Select
    End If
    TextBox1.Text = Nothing
  End Sub
End Class


这篇关于如何在第一个列表框中输入7个数字后输入切换到第二个列表框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆