有些功能还没做。 代码: Option Explicit Private Const playername As String = "乱世之尘"'玩家名字 Dim quitteammate As Boolean '踢人识别队伍变量 Dim playerteam As Boolean '当前队伍 Private Sub CmdStartGame_Click() If TeamA.ListCount = TeamB.ListCount Or TeamA.ListCount = TeamB.ListCount - 1 Or TeamB.ListCount = TeamA.ListCount - 1 Then MsgBox ("正在加载游戏中。。。") Else MsgBox ("双方人数不平衡,无法开始游戏") End If End Sub Private Sub Form_Load() Dim i As Integer For i = 1 To 5 TeamA.AddItem "player" & i TeamB.AddItem "player" & i Next i End Sub Private Sub PlayerOptionQuit_Click() '踢人菜单 If quitteammate Then RoomMsgBox.Text = RoomMsgBox.Text & vbNewLine & "玩家【" & TeamA.List(TeamA.ListIndex) & "】被房主踢出房间" TeamA.RemoveItem TeamA.ListIndex '踢掉选中的人 Else RoomMsgBox.Text = RoomMsgBox.Text & vbNewLine & "玩家【" & TeamA.List(TeamB.ListIndex) & "】被房主踢出房间" TeamB.RemoveItem TeamB.ListIndex '踢掉选中的人 End If End Sub Private Sub RoomMsgSent_Click() '发送消息 If RoomMsgEdit.Text <> "" Then RoomMsgBox.Text = RoomMsgBox.Text & vbNewLine & "【" & playername & "】:" & RoomMsgEdit.Text Else RoomMsgEdit.SetFocus End If RoomMsgEdit.Text = "" End Sub Private Sub Team_Click(Index As Integer) Select Case Index Case 1 TeamA.AddItem playername If TeamB.ListCount > 0 Then TeamB.RemoveItem TeamB.ListCount - 1 Team(1).Enabled = False Team(2).Enabled = True Case 2 TeamB.AddItem playername If TeamA.ListCount > 0 Then TeamA.RemoveItem TeamA.ListCount - 1 Team(2).Enabled = False Team(1).Enabled = True End Select End Sub Private Sub TeamA_Click()'弹出菜单 quitteammate = True PopupMenu PlayerOption1 End Sub Private Sub TeamB_Click() quitteammate = False PopupMenu PlayerOption1 End Sub