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

[µo°Ý] Userform³Ì¤j¤Æ(¥B¤º®e¤ñ¨Ò¦Û°Ê©ñ¤j?)

[µo°Ý] Userform³Ì¤j¤Æ(¥B¤º®e¤ñ¨Ò¦Û°Ê©ñ¤j?)

¥»©«³Ì«á¥Ñ PKKO ©ó 2015-5-13 17:47 ½s¿è

¤p§Ì¤wª¾Userform ³Ì¤j¤Æªºµ{¦¡½X,¤]ª¾¹D¨Ì¤ñ²v©ñ¤jªºµ{¦¡½X,¦ý¤£ª¾¹D¦p¦ó¦Û°Ê¨ú±o¨âªÌ¤§¶¡ªº¤ñ²v,¨Ó¦Û°Ê³]©w©ñ¤jªº­¿¼Æ...
¦³¤Hª¾¹Dzoomªº¤ñ²v­n¦p¦ó¨D±o¶Ü?

¤ñ²vªºµ{¦¡½X
UserForm1.Zoom = 125

³Ì¤j¤Æªºµ{¦¡½X
  1. 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
  2. Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
  3. Private Declare Function SetActiveWindow Lib "user32" (ByVal hwnd As Long) As Long
  4. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
  5. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  6. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  7. Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
  8. Private Const WS_MAXIMIZEBOX = &H10000
  9. Private Const WS_MINIMIZEBOX = &H20000
  10. Private Const GWL_STYLE = (-16)
  11. Private Const SW_SHOWMAXIMIZED = 3
  12. Private Const SW_SHOWNORMAL = 1
  13. Private Const SW_SHOWMINIMIZED = 2
  14. Private Const WS_THICKFRAME = &H40000
  15. Const SM_CXFULLSCREEN = 16
  16. Const SM_CYFULLSCREEN = 17
  17. Const HWND_TOPMOST = -1
  18. Const SWP_SHOWWINDOW = &H40
  19. Dim hWndForm As Long
  20. Dim IStyle As Long

  21. Private Sub UserForm_Initialize()
  22.   hWndForm = FindWindow("ThunderDFrame", Me.Caption)
  23.   IStyle = GetWindowLong(hWndForm, GWL_STYLE)
  24.   IStyle = IStyle Or WS_THICKFRAME
  25.   IStyle = IStyle Or WS_MINIMIZEBOX
  26.   IStyle = IStyle Or WS_MAXIMIZEBOX
  27.   SetWindowLong hWndForm, GWL_STYLE, IStyle
  28. End Sub

  29. Public Sub myShowMax()
  30.    
  31.     SetActiveWindow hWndForm
  32.     ShowWindow hWndForm, SW_SHOWMAXIMIZED
  33. End Sub
½Æ»s¥N½X
PKKO

ÁÂÁ¤j¤j­Ìªº±Ð¾É¡A¸Ñ¨M¤F¨ì2021¦~¨Ï¥Îwin10 ÁY©ñ¤ñ¨Ò§âªí®æº¡¨ì¿Ã¹õ¥~­±ªº°ÝÃD¡AÁÂÁ³á!!

TOP

¦^´_ 34# bobomi
½Ð°Ý¥Ø«e§Úªºuserform¥Î§Aªºµ{¦¡¥i¥HÅý¨Ï¥ÎªÌ¦Û¥ÑÁY©ñ¡A¦ý¬O­n«ç¼Ë¤~¯àÅý image ª«¥ó¤]¯à¸òµÛÁY©ñ???

¸Ô²Ó¤º®e¦b³o¸Ì

TOP

1.zip (50.81 KB)

¥Ø«eµo²{¦³¤@­Ó°ÝÃD
¨Ò¦p:
¥Î·Æ¹«¨åÀ»  UserForm  ¨Ï¨ä³Ì¤j¤Æ«á
·Æ¹«²¾¨ì¤u¨ã¦C¥hÂIÀ»¨º­Ó EXCEL ¹Ï¥Ü
EXCEL ¾ã¦U·|¶×ÁY¤p¨ì¤u¨ã¦C (³o³¡¤À¬O¥¿±`ªº )
¦A¦¸ÂIÀ»¨º­Ó EXCEL ¹Ï¥Ü , EXCEL ´N·|ÁÙ­ìÅܤj (³o³¡¤À¤]¬O¥¿±`ªº )
°ÝÃD¨Ó¤F
·í EXCEL ÁÙ­ìÅܤj®É
EXCEL ·|¦h¨Æªº§â  ³B©ó ³Ì¤j¤Æªº UserForm  ¦Û°Ê½Õ¦^¤@·h¤j¤p

³o­Ó¼È®É¸Ñ¨M¤£¤F

TOP

¦^´_ 32# bobomi


    ¤j¤j,·sª©ªº¨Ï¥Î¤W©Ç©Çªº

¦b¤Á´«¤£¦Pªí³æªº®É­Ô
¤U¤èµ{¦¡½Xªº¦a¤è·|µLªk°õ¦æ
  1. Private Sub UserForm_Activate()
  2.   modForm.UserForm_SetButton Me
  3. End Sub
½Æ»s¥N½X
PKKO

TOP

¥»©«³Ì«á¥Ñ bobomi ©ó 2015-5-23 19:51 ½s¿è

(1) ¤å¦r­ì¥»Åã¥Ü¥|­Ó¦r,¥u¦³¥X²{¤T­Ó¦r,²{¦b¤]¥i¦Û¦æ¾a©Ô¼e¤@ÂI´NÅã¥Ü¥X¨Ó¥¿½T¤ñ¨Ò,©Ò¥H¥|­Ó¦r³£¥i¥HÅã¥Ü
     ->  §Ú¹w³]´N¬O¤å¦r¥u¦³©Ô°ª¤~ÁY©ñ, ©Ô¼e«h¤£ÁY©ñ,  ²{¦b¤w¸g§ï¦¨©Ô¼e¤]·|ÁY©ñ
(2) ­×¥¿­ì§@¤u§@¦C¬Ý¤£¨ì¹Ï¥Ü

1.zip (48.15 KB)

TOP

¦^´_ 27# bobomi


    ¤j¤j±z¦n,«e¤@½gªº°ÝÃD§Ú³£§ä¨ìµª®×¤F,¦bSaveSetting ThisWorkbook.Name, "SSS"=>¥þ³¡ªºUSERFORM³£«ü¦V¦P¤@­Ó¦WºÙ§Y¥in­Óªí³æ³£¬Û¦P¤j¤p
¥t¥~ÁÙ¦³¤@­Ó°ÝÃD(©êºp,°ÝÃD«Ü¦h...)

´N¬OÁY¤p«ö¶s·|¥X²{¿ù»~,¤£¯àÁY¤p
§Ú¥Ø«e§@ªk¬O±NÁY¤p«ö¶s¨S±oÂI,¦³¿ìªkÅý¥L¤£·|¥X²{¿ù»~,µM«áÁY¤p¨ì¤u§@¦C,µ¥¨ì­n¥Îªº®É­Ô¦AÂI¤@¤U¤u§@¦CªºÀÉ®×´N·|¦Û°Ê¸õ¥X­ì¥»¤j¤pªºªí³æ¶Ü?
  1. ocx.Left = ocx_xy(0) * Rw
  2. ocx.Top = ocx_xy(1) * Rh
  3. ocx.Width = ocx_xy(2) * Rw
  4. ocx.Height = ocx_xy(3) * Rh
½Æ»s¥N½X
¿ù»~µo¥Í¦b¤W¤èªºheight¨ºÃä
PKKO

TOP

¥»©«³Ì«á¥Ñ PKKO ©ó 2015-5-22 22:08 ½s¿è

¦^´_ 27# bobomi


    ¤j¤j,§Ú¥u¯à»¡±z¤Ó¯«¤F!
³o­Ó¦Û¤v©Ôªº¤è¦¡«D±`´Î!
ÀuÂI¦p¤U:
¤@¡B¤ñ©p¤§«eªº¥u¦³©Ô°ª«×¤~·|Åܧó¤ñ¨Òªº¦n
¤G¡B¥i¥H¦³Àx¦s¥\¯à
¤T¡B¤ñ¨Ò§Y«K¦³°ÝÃD¤]¥i¥H¸Ñ¨M(¤å¦r­ì¥»Åã¥Ü¥|­Ó¦r,¥u¦³¥X²{¤T­Ó¦r,²{¦b¤]¥i¦Û¦æ¾a©Ô¼e¤@ÂI´NÅã¥Ü¥X¨Ó¥¿½T¤ñ¨Ò,©Ò¥H¥|­Ó¦r³£¥i¥HÅã¥Ü)

¥Ø«e¹Á¸Õ¤§«áµo²{¥H¤U°ÝÃD
1.­Y¬O¦³ÅܧóListBox¨Ã¥B,¦Û°Ê½Õ¾ãÄæ¦ì®É,µ{¦¡½X·|±Y¼ì¦b¤U¤è¶}ÀYªº¦ì¸m
  1. ocx.Left = ocx_xy(0) * Rw
  2. ocx.Top = ocx_xy(1) * Rh
  3. ocx.Width = ocx_xy(2) * Rw
  4. ocx.Height = ocx_xy(3) * Rh
½Æ»s¥N½X
A:§Ú¥Ø«e¤w¦³Â²­®ªº¸Ñ¨M¤è¦¡,¦b±Ò°Ê§ó·slistBox ªº®É­ÔcheckUpdate = True
µM«á¦bPrivate Sub UserForm_Layout() ªº²Ä¤@¦æ¿é¤J    If checkUpdate = True Then checkUpdate = False: Exit Sub
³o¼Ë§ó·slistBoxªº®É­Ô´N¤£·|°õ¦æ,µ¥¨ìlistboxµ²§ô¤§«á¥L¤S·|¦A§ó·s¤@¦¸µe­±´NOK¤F,¦]¦¸²Ä¤@­Ó°ÝÃD±o¨ì¤@­Ó§¹¬ü¦ý²­®ªº¸Ñ¨M¤è¦¡
ªþ¤W§Ú¦Û¤v¼gªºlistbox §Ö³t¨Ï¥Îµ{¦¡½X
  1. Function LISTÅã¥Ü(UserForm, LISTBOX, RNG)
  2.         checkUpdate = True
  3.         '±N¸ê®ÆÅã¥Ü¦bLISTBOX ¤W
  4.         LISTBOX.ColumnCount = UBound(RNG, 2)
  5.         LISTBOX.List = RNG 'ListBox ªºÅã¥Ü¤è¦¡
  6.         '¦Û°Ê½Õ¾ãªºµ{¦¡
  7.         '·s¼W¥H¤Ucode
  8.         Dim sWidth As String, dTotal As Double
  9.         Dim oTemp As Object
  10.         
  11.         Set oTemp = UserForm.Controls.Add("Forms.TextBox.1")
  12.         With oTemp
  13.           .AutoSize = True'¦b³o¦æµ{¦¡½Xªº¦a¤è·|±Ò°ÊPrivate Sub UserForm_Layout()¾É­P¿ù»~
  14.           .MultiLine = True
  15.           .WordWrap = False
  16.           .SelectionMargin = False
  17.           .Font.Name = LISTBOX.Font.Name
  18.           .Font.Size = LISTBOX.Font.Size
  19.         End With
  20.         
  21.         For j = 0 To LISTBOX.ColumnCount - 1
  22.           oTemp.Text = ""
  23.           For i = 0 To LISTBOX.ListCount - 1
  24.             oTemp.Text = oTemp.Text & LISTBOX.List(i, j) & vbCr
  25.           Next
  26.           dTotal = dTotal + oTemp.Width
  27.           sWidth = sWidth & oTemp.Width + 10 & ";"
  28.         Next
  29.         UserForm.Controls.Remove oTemp.Name
  30.         LISTBOX.ColumnWidths = sWidth
  31. End Function
½Æ»s¥N½X
2.­Y§Ú¦³4­ÓuserForm,­n¦p¦ó¦Û°Ê¦s¨ú¦P¤@­ÓGetSetting¡BSaveSetting,Åý¥|­Óµøµ¡ªº¤j¤p³£·|¬Û¦P
A:¥Ø«e§ÚÁÙ¦b¬ã¨s³o­Ó³¡¤À
PKKO

TOP

¦^´_ 26# GBKEE

¶Wª©¤j¤j,½T¹êµøµ¡¤w¸g¨ì¤u§@¦C¤W¤è¤F

¥i¬O...
1.¤ñ¨Ò¤£¹ï,­ì¥»¹ï»ô¦b¤ô¥­½u¤Wªº¨â­Ó¤¸¥ó,·|Åܦ¨¤@¤W¤@¤U
2.ÁöµMµøµ¡¶]¨ì¤u§@¦C¤W¤è¤F,¥i¬O¤º®e¨Ã¨S¦³À£ÁY,¾É­P­ì¥»­nÅã¥Üªº¤¸¥ó,µLªkÅã¥Ü¥X¨Ó(³QÃä¬É¥d±¼¤F)
PKKO

TOP

¦^´_ 28# bobomi
­ì¨Ó VBA ¦³GetSetting¡BSaveSetting ¥i¥H¦s¨úµù¥Uªí
¾Ç¨ì¤F~

ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

        ÀR«ä¦Û¦b : Ãø¦æ¯à¦æ¡AÃø±Ë¯à±Ë¡AÃø¬°¯à¬°¡A¤~¯àª@µØ¦Û§Úªº¤H®æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD