编程论坛's Archiver

zzdxh005 发表于 2008-5-24 17:03

请问一下我的哪里错了?

我是刚开始学VB的,这段代码我不知道错在哪里了?
我编写的却没有反应,按哪一个键都没有反应!!!!

Private Sub Cmd1_Click()
Label1.BorderStyle = 1
'为Label1添加边框
End Sub
Private Sub Cmd2_Click()
Label1.Font = "隶书"
'设置标签中文字的字体为隶书
Label1.FontSize = 15
'设置标签中文字的字体为15号字
Label1.FontBold = True
'设置标签中文字的字体为粗体
EndSub
Private Sub Cmd3_Click()
Label1.Visible = False
'将标签设置为隐藏
End Sub
Private Sub Cmd4_Click()
Label1.Alignment = 2
'设置标签中文字的对齐方式为居中形式
End Sub
Private Sub Cmd5_Click()


Label1.BorderStyle = 0
'将Label1边框取消
Label1.Visible = True
'将标签恢复显示
Label1.Font = "宋体"
'设置标签中文字的字体大小为12号字
Label1.FontBold = True
'设置标签中文字的字体为常规
Label1.Alignment = 0
'设置标签中文字的对齐方式为左对齐形式
End Sub

三断笛 发表于 2008-5-24 20:05

估计是控件名称有问题
看看属性列表里的按钮名称和程序中的按钮名称是不是一样的

flyue 发表于 2008-5-25 14:54

看代码没有发现什么错误

multiple1902 发表于 2008-5-25 15:02

Private Sub Cmd1_Click()
Label1.BorderStyle = 1
'为Label1添加边框
End Sub
Private Sub Cmd2_Click()
Label1.Font = "隶书"
'设置标签中文字的字体为隶书
Label1.FontSize = 15
'设置标签中文字的字体为15号字
Label1.FontBold = True
'设置标签中文字的字体为粗体
[color=Red]EndSub[/color]
Private Sub Cmd3_Click()
Label1.Visible = False
'将标签设置为隐藏
End Sub
Private Sub Cmd4_Click()
Label1.Alignment = 2
'设置标签中文字的对齐方式为居中形式
End Sub
Private Sub Cmd5_Click()


Label1.BorderStyle = 0
'将Label1边框取消
Label1.Visible = True
'将标签恢复显示
Label1.Font = "宋体"
'设置标签中文字的字体大小为12号字
Label1.FontBold = True
'设置标签中文字的字体为常规
Label1.Alignment = 0
'设置标签中文字的对齐方式为左对齐形式
End Sub

[[it] 本帖最后由 multiple1902 于 2008-5-25 18:11 编辑 [/it]]

flyue 发表于 2008-5-25 17:14

版主不要咬文嚼字了,关键是要帮他解决问题

lzn3303768 发表于 2008-5-25 21:34

回复 5# flyue 的帖子

你是否看了他程序的效果

multiple1902 发表于 2008-5-25 21:37

我编译的结果在4楼。

zzdxh005 发表于 2008-5-25 22:38

可是还是不可以啊!!
我把EndSub有改成了End Sub 中间加了一个空格!
可是我翻译的怎么不就不行了那!

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.