标题:[求助] 这个调用程序怎么写
只看楼主
xz3501
Rank: 1
等 级:新手上路
帖 子:39
专家分:0
注 册:2007-5-12
 问题点数:0 回复次数:3 
[求助] 这个调用程序怎么写



帮我看看这个调用程序怎么写
那个按纽功能怎么弄啊,关键

·清除列表框和文本框中的内容
·使“删除项目”按纽禁用
·在第三个标签中显示当前列表框中的项目数
(7)单击“退出”按纽后,结束程序运行

[此贴子已经被作者于2007-6-4 15:24:44编辑过]



btKEtNbJ.rar (22.12 KB) [求助] 这个调用程序怎么写



nnfH0cVV.jpg (63.64 KB)
2007-06-02 21:29
ouzhiguang
Rank: 1
来 自:湖南长沙
等 级:新手上路
威 望:1
帖 子:240
专家分:0
注 册:2007-5-18
得分:0 

Private Sub Command1_Click()
If Text1.Text <> "" Then
For i = 0 To List1.ListCount
If Text1.Text = List1.List(i) Then
MsgBox "该学生已经存在!"
Exit Sub
End If
Next i
List1.AddItem Text1.Text
Label3.Caption = List1.ListCount
End If
End Sub

Private Sub Command2_Click()
Dim r As Integer
If List1.ListIndex <> -1 Then
r = MsgBox(" 您确定要删除该项目?", vbInformation + vbYesNo)
If r = vbYes Then
List1.RemoveItem List1.ListIndex
Label3.Caption = List1.ListCount
If List1.ListCount = 0 Then
Text1.Text = ""
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
End If
End If
Else
MsgBox "没有选择学生,不能删除列表项!"
End If
End Sub

Private Sub Command3_Click()
Text1.Text = ""
Text1.SetFocus
End Sub

Private Sub Command4_Click()
End
End Sub

Private Sub Form_Load()
If List1.Columns = 0 Then
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
End If
End Sub

Private Sub Text1_Click()
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
End Sub

2007-06-03 14:17
xz3501
Rank: 1
等 级:新手上路
帖 子:39
专家分:0
注 册:2007-5-12
得分:0 

我的代码是:
Private Sub Command1_Click()
List1.AddItem Text1.Text
Text1.Text = ""
Text1.SetFocus
Label3.Caption = List1.ListCount
End Sub

Private Sub Command2_Click()
List1.RemoveItem List1.ListIndex
Label3.Caption = List1.ListCount
End Sub

Private Sub Command3_Click()
List1.Clear
Text1.Text = ""
Command2.Enabled = False
Label3.Caption = List1.ListCount
End Sub

Private Sub Command4_Click()
End
End Sub

Private Sub Form_Load()
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
End Sub

Private Sub Text1_Change()
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
End Sub
谢谢你,站们可以好好交流一下


2007-06-04 15:11
xz3501
Rank: 1
等 级:新手上路
帖 子:39
专家分:0
注 册:2007-5-12
得分:0 
我也是刚刚弄出来的

2007-06-04 15:12



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-144399-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.867361 second(s), 9 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved