VB语言翻译,求大婶

PrivateSubForm_KeyDown(KeyCodeAsInteger,ShiftAsInteger)DimCAsLongIfKeyCode=27ThenEndI... Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim C As Long
If KeyCode = 27 Then End
If KeyCode = 32 Then
If Timer1.Enabled = True Then
Timer1.Enabled = False
Label1.Visible = True
Else
Timer1.Enabled = True
Label1.Visible = False
End If
End If
C = UBound(She)
If GFangXiang = True Then Exit Sub
Select Case KeyCode
Case 37
If She(C).F = 2 Then Exit Sub
She(C).F = 0
GFangXiang = True
Case 38
If She(C).F = 3 Then Exit Sub
She(C).F = 1
GFangXiang = True
Case 39
If She(C).F = 0 Then Exit Sub
She(C).F = 2
GFangXiang = True
Case 40
If She(C).F = 1 Then Exit Sub
She(C).F = 3
GFangXiang = True
End Select
End Sub
Private Sub Form_Load()
Me.AutoRedraw = True
Me.BackColor = &HC000&
Me.FillColor = 255
Me.FillStyle = 0
Me.ScaleWidth = 24
Me.ScaleHeight = 24
Me.WindowState = 2
Set Timer1 = Controls.Add("VB.Timer", "Timer1")
Set Label1 = Controls.Add("VB.Label", "Label1")
Label1.AutoSize = True
Label1.BackStyle = 0
Label1 = "暂停"
Label1.ForeColor = RGB(255, 255, 0)
Label1.FontSize = 50
ChuShiHua
End Sub
后面还有,发不了这么多,先求大神
展开
 我来答
牧固图大陆
2014-07-02 · 超过46用户采纳过TA的回答
知道答主
回答量:100
采纳率:88%
帮助的人:15.9万
展开全部
一个按键处理事件而已。
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim C As Long ’定义C为长整型变量
If KeyCode = 27 Then End ‘如果按ESC键就终止程序
If KeyCode = 32 Then ’如果按下空格建,显示/隐藏timer1并隐藏/显示lable1
If Timer1.Enabled = True Then
Timer1.Enabled = False
Label1.Visible = True
Else
Timer1.Enabled = True
Label1.Visible = False
End If
End If
C = UBound(She) 'C取得She数组的最大下标,不知道She定义
If GFangXiang = True Then Exit Sub
Select Case KeyCode ‘还是按键,根据按下不同的建,为she最后一个元素的.F属性赋值,并修改GFangXiang的值
Case 37 ’如果按下“左箭头”
If She(C).F = 2 Then Exit Sub
She(C).F = 0
GFangXiang = True
Case 38 ‘如果按“上箭头”
If She(C).F = 3 Then Exit Sub
She(C).F = 1
GFangXiang = True
Case 39 如果按“右箭头”
If She(C).F = 0 Then Exit Sub
She(C).F = 2
GFangXiang = True
Case 40 如果按“下箭头”
If She(C).F = 1 Then Exit Sub
She(C).F = 3
GFangXiang = True
End Select
End Sub

Private Sub Form_Load() ’装入窗体时候先设置窗体的样式
Me.AutoRedraw = True
Me.BackColor = &HC000&
Me.FillColor = 255
Me.FillStyle = 0
Me.ScaleWidth = 24
Me.ScaleHeight = 24
Me.WindowState = 2
Set Timer1 = Controls.Add("VB.Timer", "Timer1") ‘在窗体中加入计时器控件timer1
Set Label1 = Controls.Add("VB.Label", "Label1") ’加入Label1文本标签
Label1.AutoSize = True '设置标签的样式
Label1.BackStyle = 0
Label1 = "暂停"
Label1.ForeColor = RGB(255, 255, 0)
Label1.FontSize = 50
ChuShiHua ‘这里应该是个初始化事件
End Sub
追问
谢了,还有一小部分,一会用电脑发给你
08062400
2014-07-02 · TA获得超过118个赞
知道答主
回答量:114
采纳率:50%
帮助的人:26.8万
展开全部
时间发生器吗?
更多追问追答
追问
这是贪吃蛇的一个vb源代码,我还没有发完,超过字数限制了
这是贪吃蛇的一个vb源代码,我还没有发完,超过字数限制了
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式