- ©«¤l
- 97
- ¥DÃD
- 33
- ºëµØ
- 0
- ¿n¤À
- 129
- ÂI¦W
- 0
- §@·~¨t²Î
- Win 7
- ³nÅ骩¥»
- office 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2019-5-7
- ³Ì«áµn¿ý
- 2022-8-25
|
¦³°ª¤â¥i¥HÀ°§Ú¬Ý¬Ý§Ú³o¼Ë¸ÑÄÀ¹ï¶Ü???@@- Dim ocx_First_wh As New Collection
- Dim Fomr_TopBarHeight
- Dim hWndForm As Long
- Dim IStyle As Long
-
- Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
- Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
- Private Declare Function SetActiveWindow Lib "user32" (ByVal hWnd As Long) As Long
- Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
- Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
- Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
- Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
- Private Const WS_MAXIMIZEBOX = &H10000
- Private Const WS_MINIMIZEBOX = &H20000
- Private Const GWL_STYLE = (-16)
- Private Const SW_SHOWMAXIMIZED = 3
- Private Const SW_SHOWNORMAL = 1
- Private Const SW_SHOWMINIMIZED = 2
- Private Const WS_THICKFRAME = &H40000
- Const SM_CXFULLSCREEN = 16
- Const SM_CYFULLSCREEN = 17
- Const HWND_TOPMOST = -1
- Const SWP_SHOWWINDOW = &H40
-
- Private Sub CommandButton1_Click() '¶×¤J¹Ï±
- With Application.FileDialog(msoFileDialogFilePicker)
- .Filters.Add "ImageFile", "*.jpg; *.jpeg; *.mp4", 1
- .AllowMultiSelect = False
- If .Show = -1 Then
- Image1.Picture = LoadPicture(.SelectedItems(1))
- End If
- End With
- End Sub
- Private Sub UserForm_Initialize() 'ªí³æªì©l¤Æ
- 'userform³Ì¤j¡B³Ì¤p¤Æ«ö¶sªºÅã¥Ü
- hWndForm = FindWindow("ThunderDFrame", Me.Caption)
- IStyle = GetWindowLong(hWndForm, GWL_STYLE)
- IStyle = IStyle Or WS_THICKFRAME
- IStyle = IStyle Or WS_MINIMIZEBOX
- IStyle = IStyle Or WS_MAXIMIZEBOX
- SetWindowLong hWndForm, GWL_STYLE, IStyle
- 'ªì©l¤Æµøµ¡¤j¤p
- A = Height
- Height = 0
- Fomr_TopBarHeight = Height
- Fomr_TopBarHeight = Fix(Fomr_TopBarHeight)
- Height = A + 1.5
- With Frame1
- '³o±N³Ð«Ø¤@Ó««ª½¤@Ó¤ô¥ºu°Ê±ø¡AfmScrollBarsHorizontalÅã¥Ü¤ô¥±²¶b¡AfmScrollBarsVerticalÅã¥Ü««ª½±²¶b¡AfmScrollBarsBothÅã¥Ü¤ô¥»P««ª½±²¶b¨âªÌ¡C
- .ScrollBars = fmScrollBarsBoth
- '®Ú¾Ú±zªºn¨D§ó§ïÈ2
- .ScrollHeight = .InsideHeight * 2
- .ScrollWidth = .InsideWidth * 2
- End With
- '®Ú¾Ú²£«~½s¸¹¦Û°Ê±q²£«~¹Ï±¸ê®Æ§¨¶×¤J¹Ï±
- imgname = ActiveWorkbook.Sheets("ºÞ¨îpµeªí").Range("I4").Value
- Dim imgpath As String
- imgpath = "\\G-server\²£«~¼i¾ú\«È¤á\00.½d¥»\²£«~¹Ï±"
- With Image1
- .Picture = LoadPicture(imgpath & "\" & imgname & ".jpg")
- .AutoSize = True
- .BorderStyle = fmBorderStyleNone
- .PictureSizeMode = fmPictureSizeModeZoom
- End With
- With Frame1
- .BorderStyle = fmBorderStyleNone
- .PictureSizeMode = fmPictureSizeModeZoom
- End With
- End Sub
- Private Sub CommandButton3_Click() '¹Ï¹³ÁY¤pÁä
- Me.Image1.Height = Me.Image1.Height - 200
- Me.Image1.Width = Me.Image1.Width - 200
- End Sub
- Private Sub CommandButton2_Click() '¹Ï¹³©ñ¤jÁä
- Me.Image1.Height = Me.Image1.Height + 200
- Me.Image1.Width = Me.Image1.Width + 200
- End Sub
- Public Sub myShowMax() 'userform ³Ì¤j¤Æ
- SetActiveWindow hWndForm
- ShowWindow hWndForm, SW_SHOWMAXIMIZED
- End Sub
- Private Sub UserForm_Layout()
- '¨ú±o¥Ø«eµøµ¡¤j¤p
- If ocx_First_wh.Count = 0 Then
- ocx_First_wh.Add Key:="UserForm", Item:=Array(, Array(Left, Top, Width, Height, Font.Size, ""))
- On Error Resume Next
- For Each s In Controls
- ocx_First_wh.Add Key:=s.Name, Item:=Array(s, Array(s.Left, s.Top, s.Width, s.Height, s.Font.Size))
- If Err Then
- ocx_First_wh.Add Key:=s.Name, Item:=Array(s, Array(s.Left, s.Top, s.Width, s.Height, Empty))
- End If
- Next
- On Error GoTo 0
- Form_xy = GetSetting(ThisWorkbook.Name, Name, "Form_Size")
- '³Ì¤j¤Æµøµ¡Ä²µo®É
- If Form_xy <> "" Then
- Form_xy = Split(Form_xy + String(5, ","), ",")
- If Form_xy(5) = "max" Then
- myShowMax
- Else
- On Error Resume Next
- Move Form_xy(0), Form_xy(1), Form_xy(2), Form_xy(3)
- On Error GoTo 0
- End If
- End If
- Exit Sub
- End If
- 'pºâµøµ¡¤j¤p?????
- Form_xy = ocx_First_wh("UserForm")(1)
- Rw = Width / Form_xy(2)
- Rh = (Height - Fomr_TopBarHeight) / (Form_xy(3) - Fomr_TopBarHeight)
- Rwh = IIf(Rw < Rh, Rw, Rh)
- '·íÁY©ñuserform®É¡A¸Ì±ªºª«¥ó¤]¸òµÛÅÜ°Ê
- For w = 2 To ocx_First_wh.Count
- Set ocx = ocx_First_wh(w)(0)
- ocx_xy = ocx_First_wh(w)(1)
- ocx.Left = ocx_xy(0) * Rw
- ocx.Top = ocx_xy(1) * Rh
- ocx.Width = ocx_xy(2) * Rw
- ocx.Height = ocx_xy(3) * Rh
- If TypeOf ocx Is CommandButton Then
- ocx.FontSize = ocx_xy(4) * Rwh
- Else
- End If
- Next
- 'Àx¦s¥Ø«eµøµ¡ªº¤j¤p
- On Error Resume Next
- Height = Height
- SaveSetting ThisWorkbook.Name, Name, "Form_Size", Join(Array(Left, Top, Width, Height, 0, IIf(Err, "max", "")), ",")
- End Sub
½Æ»s¥N½X |
|