ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

Excel VBA ¦p¦ó¦Û°Ê½Õ¾ãªí³æ¤j¤p

¦^´_ 1# Jared
´£¨Ñ¤@­Ó¤èªk¡A®Ú¾Úªí³æªº½ÆÂø«×¡A®ÄªG¥i¯à¤£¤@©w«Ü¦n¡A¨Ñ§A°Ñ¦Ò¡G
¦b¸Óªí³æªºµ{¦¡½X¥[¤W¤U­±Code¡A¶}±Òªí³æ«á¡A¦bªí³æ¤W«ö¡G
Ctrl+·Æ¹«¥ªÁä©ì¦²¦V¤W¡A¥i©ñ¤jªí³æ
Ctrl+·Æ¹«¥ªÁä©ì¦²¦V¤U¡A¥iÁY¤pªí³æ
  1. Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  2.   Static lastY As Single
  3.   
  4.   If Button = 1 And Shift = 2 Then
  5.     If Y - lastY > 5 Then
  6.       ResizeUserform 1.1
  7.       lastY = Y
  8.     ElseIf lastY - Y > 5 Then
  9.       ResizeUserform 0.9
  10.       lastY = Y
  11.     End If
  12.   End If
  13. End Sub

  14. Private Sub ResizeUserform(dSizeCoeff As Double)
  15.   Dim c  
  16.   With Me
  17.     .Width = .Width * dSizeCoeff
  18.     .Height = .Height * dSizeCoeff
  19.    
  20.     For Each c In .Controls
  21.       With c
  22.         .Top = .Top * dSizeCoeff
  23.         .Left = .Left * dSizeCoeff
  24.         .Width = .Width * dSizeCoeff
  25.         .Height = .Height * dSizeCoeff
  26.         
  27.         On Error Resume Next
  28.         .Font.Size = .Font.Size * dSizeCoeff
  29.         On Error GoTo 0
  30.       End With
  31.     Next
  32.   End With
  33. End Sub
½Æ»s¥N½X

TOP

¦^´_ 3# GBKEE
¤Ó¦n¤F¡A§ÚÁÙ¤@ª½¦b·Q¾Þ§@¤Ó¦h¦¸¦r«¬¥i¯à·|Åܱ¼¡C
ÁÙ­ì¬O­Ó¦n¥D·N¡I

TOP

        ÀR«ä¦Û¦b : ¤H¥Í¨S¦³©Ò¦³Åv¡A¥u¦³¥Í©Rªº¨Ï¥ÎÅv¡C
ªð¦^¦Cªí ¤W¤@¥DÃD