Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!

[通知] 统计VBA学习小组正式组的积分帖之作业上交贴(第20周)

  [复制链接]
发表于 2012-6-4 23:30 | 显示全部楼层
  1. Private Sub UserForm_Click()
  2. Unload Me
  3. End Sub

  4. Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
  5. Dim X As Integer
  6. X = Me.Height
  7. If KeyCode = 27 Then
  8. Call UserForm_Click
  9. End If
  10. If KeyCode = 88 And Shift = 2 Then
  11. X = X + 10
  12. Me.Height = X
  13. End If
  14. If KeyCode = 90 And Shift = 2 Then
  15. X = X - 10
  16. Me.Height = X
  17. End If
  18. End Sub

  19. Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  20. If Button = 1 And Shift = 3 Then
  21. Call UserForm_Click
  22. End If
  23. End Sub
复制代码
作业20周.rar (14.65 KB, 下载次数: 2)

评分

参与人数 1金币 +10 收起 理由
兰色幻想 + 10 答案正确

查看全部评分

excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
回复

使用道具 举报

发表于 2012-6-4 23:57 | 显示全部楼层
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)

Dim X As Integer
If KeyCode = 27 Then
Unload Me
End If
MsgBox KeyCode
If KeyCode = 65 And Shift = 2 Then
X = Me.Height + 10
Me.Height = X
End If
If KeyCode = 88 And Shift = 2 Then
X = Me.Height - 10
Me.Height = X
End If
MsgBox Me.Height

End Sub
Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Button = 1 And Shift = 3 Then
Unload Me
End If
End Sub

评分

参与人数 1金币 +10 收起 理由
兰色幻想 + 10 答案正确

查看全部评分

回复

使用道具 举报

发表于 2012-6-5 08:14 | 显示全部楼层
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
  
    If KeyCode = 27 Then
        Unload Me
    ElseIf KeyCode = 90 And Shift = 2 Then
        Me.Height = Me.Height + 10
    ElseIf KeyCode = 88 And Shift = 2 Then
        Me.Height = Me.Height - 10
    End If
End Sub
Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    If Button = 1 And Shift = 3 Then
        Unload Me
    End If
End Sub

评分

参与人数 1金币 +10 收起 理由
兰色幻想 + 10 答案正确

查看全部评分

回复

使用道具 举报

发表于 2012-6-5 10:34 | 显示全部楼层
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 27 Then
    Unload Me
End If
If KeyCode = 90 And Shift = 2 Then
    Me.Height = Me.Height + 10
End If
If KeyCode = 88 And Shift = 2 Then
     Me.Height = Me.Height - 10
End If
If KeyCode = 16 And Shift = 2 Then
     Me.Height = Me.Height - 10
End If
End Sub
Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
   If Button = 1 And Shift = 3 Then
     Unload Me
   End If
End Sub
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-4-29 02:23 , Processed in 0.272811 second(s), 17 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表