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

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

¥»©«³Ì«á¥Ñ GBKEE ©ó 2015-5-20 14:00 ½s¿è

¦^´_ 19# PKKO
ª½±µ©ñ¤j
  1. Option Explicit
  2. Dim Form_Tag As Variant
  3. Private Sub UserForm_Initialize()  'ªí³æªì©l¤Æªºµ{¦¡
  4.     Dim e As Control
  5.     Form_Tag = Split(Top & "," & Left & "," & Width & "," & Height & "," & Font.Size, ",")
  6.     Form_xlMax
  7. End Sub
  8. Private Sub Form_xlMax() 'ªí³æ³Ì¤j¤Æ
  9.     Dim xZoom As Double, yZoom As Double, e As Control
  10.     With Application
  11.         .WindowState = xlMaximized
  12.         xZoom = .Width / Form_Tag(2)    '¼e©ñ¤jªº¤ñ¨Ò
  13.         yZoom = .Height / Form_Tag(3)   '°ª©ñ¤jªº¤ñ¨Ò
  14.     End With
  15.     Top = 0
  16.     Left = 0
  17.     Width = Width * xZoom
  18.     Height = Height * yZoom
  19.     For Each e In Controls
  20.         With e
  21.             .Top = .Top * xZoom
  22.             .Left = .Left * xZoom
  23.             .Width = .Width * xZoom
  24.             .Height = .Height * yZoom
  25.             .Font.Size = .Font.Size * xZoom
  26.         End With
  27.     Next
  28. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 20# bobomi


    ¤ñ¨Ò¤WÁÙ¬O·|¦³ÂI©_©Ç,©ñ¨ì³Ì¤j®É,¥kÃä·|¦³¦h¾lªºªÅ¶¡,¤£¹L¨SÃö«Y,¤w¸g«Ü·PÁ©pÅo!
PKKO

TOP

¦^´_ 21# GBKEE


    ·PÁ¶Wª©¤j¤j,³o­Ó¶W¦n¥Îªº¤F(¦Ó¥Bµ{¦¡½X«Ü²µu)
¥u¬Oªí³æ°»´úªº°ª«×³¡¤À,¥L·|°»´ú¾ã­Ó¿Ã¹õªº°ª«×
µLªk¥u°»´ú¨ì¤u§@¦Cªº°ª«×´N¦n

¾É­P¤u§@¦Cªº¦ì¸m·|»\±¼userformªºÅã¥Ü
¤£¹L¤£¥´ºò,userfrom³Ì¤U¤è¤£­n©ñ¤¸¥ó´N¦n!
PKKO

TOP

¦^´_ 23# PKKO

zoom ´N¥u¯à³o¼Ë (¥¦ªº¼e°ª³£¥u¯à¬O¬Û¦P¤ñ¨Ò)
­n·Q ¤UÃ䪺±±¥ó¤£·|¹LÀY, ¨º»ò¥kÃä´N·|¦³¦h¾lªºªÅ¶¡  
­n·Q¥kÃä¨S¦³¦h¾lªºªÅ¶¡ , ¨º»ò¤UÃ䪺±±¥ó´N·|¹LÀY

¦Û¤vÁY©ñ¨S¦³¤W­±°ÝÃD ( ¦ý¬O¦r«¬µLªk§¹¬üÁY©ñ  )
²×·¥¤@ÂI  ¦Û¤vÁY©ñ + Zoom ²V·f -> ¦r«¬¥i¥H¸û§¹¬üÁY©ñ

TOP

1.zip (2.71 KB)
³o¼ËÁÙ·|»\¨ì¶Ü?

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2015-5-22 06:42 ½s¿è

¦^´_ 24# PKKO
¾É­P¤u§@¦Cªº¦ì¸m·|»\±¼userformªºÅã¥Ü
¤£¹L¤£¥´ºò,userfrom³Ì¤U¤è¤£­n©ñ¤¸¥ó´N¦n!

³o¼Ë¥i¥H¶Ü?
  1. Option Explicit
  2. Dim Form_Tag As Variant
  3. Private Sub UserForm_Activate()
  4.     Form_xlMax
  5. End Sub
  6. Private Sub Form_xlMax() 'ªí³æ³Ì¤j¤Æ
  7.     Dim xZoom As Double, yZoom As Double, e As Control
  8.     With Application
  9.         .WindowState = xlMaximized
  10.         xZoom = .Width / Me.Width     '¼e©ñ¤jªº¤ñ¨Ò
  11.         '****************
  12.         yZoom = .Height / (Me.Height + 20)  '°ª©ñ¤jªº¤ñ¨Ò
  13.         '****************
  14.     End With
  15.     Top = 0
  16.     Left = 0
  17.     Width = Width * xZoom
  18.     Height = Height * yZoom
  19.     For Each e In Controls
  20.         With e
  21.             .Top = .Top * xZoom
  22.             .Left = .Left * xZoom
  23.             .Width = .Width * xZoom
  24.             .Height = .Height * yZoom
  25.             .Font.Size = .Font.Size * yZoom
  26.         End With
  27.     Next
  28. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

³o¼ËÁÙ·|»\¨ì¶Ü?
bobomi µoªí©ó 2015-5-21 21:18


  ©_©Ç«¨!!  §Ú¶×¥XªºÀɮ׬°¦ó¤£¬O¨S§ó·s, ¤£µM´N¬O¨S¦³ UseForm
­«·s¤W¶Ç

¦ÛÁY.zip (22.41 KB)

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

¦^´_ 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

¥»©«³Ì«á¥Ñ 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

        ÀR«ä¦Û¦b : ¤@­Ó¯Ê¤fªºªM¤l¡A¦pªG´«¤@­Ó¨¤«×¬Ý¥¦¡A¥¦¤´µM¬O¶êªº¡C
ªð¦^¦Cªí ¤W¤@¥DÃD