【VB开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了VB开源代码-kjtest2.frm的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
VERSION 5.00
Begin VB.Form frmmain
Caption = "控件使用实例2"
ClientHeight = 2550
ClientLeft = 60
ClientTop = 450
ClientWidth = 4575
LinkTopic = "Form1"
ScaleHeight = 2550
ScaleWidth = 4575
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "退出"
Height = 375
Left = 1800
TabIndex = 4
Top = 1680
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "<--"
Height = 375
Left = 1800
TabIndex = 3
Top = 960
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "-->"
Height = 375
Left = 1800
TabIndex = 2
Top = 360
Width = 1095
End
Begin
VB.ListBox List1
Height = 1860
ItemData = "Form1.frx":0000
Left = 3120
List = "Form1.frx":000D
TabIndex = 1
Top = 360
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "Form1.frx":0026
Left = 240
List = "Form1.frx":0028
TabIndex = 0
Top = 360
Width = 1335
End
End
Attribute VB_Name = "frmmain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim i As Integer
If Trim(Combo1.Text) = "" Then
MsgBox "请从左侧的组合框中输入或者选择列表项!"
Combo1.SetFocus
Exit Sub
End If
For i = 0 To List1.ListCount - 1
List1.ListIndex = i
If List1.Text = Trim(Combo1.Text) Then
MsgBox "该内容在右侧的列表框中已经存在!"
Exit Sub
End If
Next i
List1.AddItem Trim(Combo1.Text)
If Combo1.ListIndex >= 0 Then
Combo1.RemoveItem Combo1.ListIndex
End If
End Sub
Private Sub Command2_Click()
Dim i As Integer
If Trim(List1.Text) = "" Then
MsgBox "请从右侧的
列表框中选择列表项!"
List1.SetFocus
Exit Sub
End If
For i = 0 To Combo1.ListCount - 1
Combo1.ListIndex = i
If Combo1.Text = Trim(List1.Text) Then
MsgBox "该内容在左侧的组合框中已经存在!"
Exit Sub
End If
Next i
Combo1.AddItem Trim(List1.Text)
List1.RemoveItem List1.ListIndex
End Sub
Private Sub Command3_Click()
End
End Sub