| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 480 人关注过本帖
标题:输入窗口程序
取消只看楼主 加入收藏
海通
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2007-3-18
收藏
 问题点数:0 回复次数:2 
输入窗口程序

Private Sub Command1_Click()
Dim name As String * 10
Dim sex As String * 2
Dim lab As String
Dim lik As String
If Text1.Text <> "" Then
name = Text1.Text
Else
MsgBox "请输入姓名!"
Text1.SetFocus
End If
lab = "姓名:" & vbCrLf & name & vbCrLf
If Option1 Then
sex = "男"
Else
sex = "女"
End If
lab = lab & "性别:" & sex & vbCrLf & vbCrLf & "爱好:" & vbCrLf
If Check1.Value = 1 Then lik = "上网" & vbCrLf
If Check2.Value = 1 Then lik = lik & "旅游" & vbCrLf
If Check3.Value = 1 Then lik = lik & "读书" & vbCrLf
If Check4.Value = 1 Then lik = lik & "书法" & vbCrLf
If Check5.Value = 1 Then lik = lik & "打球" & vbCrLf
If Check6.Value = 1 Then lik = lik & "游泳" & vbCrLf
Label2.Caption = lab & lik
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub

Private Sub Text1_Change()
Option1.Value = True
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
Check4.Value = 0
Check5.Value = 0
Check6.Value = 0
Label2.Caption = ""
End Sub


请问前边定义NAME和SEX时为什么加*10和*2

lab = "姓名:" & vbCrLf & name & vbCrLf,这一句为什么那么多&VBCRLF

搜索更多相关主题的帖子: 窗口 输入 
2007-04-14 20:04
海通
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2007-3-18
收藏
得分:0 
Option1.Value = True
这句是什么意思?
2007-04-14 23:19
海通
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2007-3-18
收藏
得分:0 
请指教,谢谢
2007-04-14 23:28
快速回复:输入窗口程序
数据加载中...
 
   



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

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