Advertisement
Dotterbart

Access Form Size

May 29th, 2024
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. Public Function PrintFormSize()
  2. 'Formular1
  3. Debug.Print "Formular1"
  4. Debug.Print "H " & Forms!Formular1.Form.WindowHeight
  5. Debug.Print "W " & Forms!Formular1.Form.WindowWidth
  6. Debug.Print "W2 " & Forms!Formular1.Form.Width
  7. Debug.Print "L " & Forms!Formular1.Form.WindowLeft
  8. Debug.Print "T " & Forms!Formular1.Form.WindowTop
  9. Debug.Print vcbcrlf
  10. 'ab hier beziehen sich die Masse auf auf Formular1.Window...
  11. 'Formular2Container
  12. Debug.Print "Formular2Container"
  13. Debug.Print "H " & Forms!Formular1.Form.Formular2Container.Height
  14. Debug.Print "W " & Forms!Formular1.Form.Formular2Container.Width
  15. Debug.Print "L " & Forms!Formular1.Form.Formular2Container.Left
  16. Debug.Print "T " & Forms!Formular1.Form.Formular2Container.Top
  17. Debug.Print vcbcrlf
  18. 'Formular 3 cntainer
  19. Debug.Print "Formular3Container"
  20. Debug.Print "H " & Forms!Formular1.Form.Formular2Container.Form.Formular3Container.Height
  21. Debug.Print "W " & Forms!Formular1.Form.Formular2Container.Form.Formular3Container.Width
  22. Debug.Print "L " & Forms!Formular1.Form.Formular2Container.Form.Formular3Container.Left
  23. Debug.Print "T " & Forms!Formular1.Form.Formular2Container.Form.Formular3Container.Top
  24. Debug.Print vcbcrlf
  25. End Function
  26.  
  27. Public Function Resize_Forms()
  28. On Error Resume Next 'Ist hier erlaubt weil extreme Auflösungen zu fehlern führen können width ist integer nicht long
  29. Dim MainFormHeight As Integer
  30. Dim MainFormWidth As Integer
  31. Dim MainFormLeft As Integer
  32. Dim MainFormTop As Integer
  33. Dim ContainerForm2Height As Integer
  34. Dim ContainerForm2Width As Integer
  35. Dim ContainerForm2Left As Integer
  36. Dim ContainerForm3Height As Integer
  37. Dim ContainerForm3Width As Integer
  38. Dim ContainerForm3Left As Integer
  39. Dim ContainerForm3Top As Integer
  40. 'Formular1 Haupt Formular
  41. MainFormHeight = Forms!Formular1.Form.WindowHeight
  42. MainFormWidth = Forms!Formular1.Form.WindowWidth
  43. MainFormLeft = Forms!Formular1.Form.WindowLeft
  44. MainFormTop = Forms!Formular1.Form.WindowTop
  45. 'ab hier beziehen sich die Masse auf auf Formular1.Window...
  46. 'Formular2Container Subformular 1 in Hauptformular
  47. ContainerForm2Height = MainFormHeight * 0.9
  48. ContainerForm2Width = MainFormWidth * 0.9
  49. Forms!Formular1.Form.Formular2Container.Height = ContainerForm2Height
  50. Forms!Formular1.Form.Formular2Container.Width = ContainerForm2Width
  51. ContainerForm2Left = (MainFormWidth - ContainerForm2Width) / 2.5
  52. Forms!Formular1.Form.Formular2Container.Left = ContainerForm2Left
  53. Forms!Formular1.Form.Formular2Container.Top = 225
  54.  
  55. 'Formular 3 cntainer Subformular 2 in Subformular 1
  56. ContainerForm3Height = ContainerForm2Height * 0.9
  57. ContainerForm3Width = ContainerForm2Width * 0.9
  58. ContainerForm3Top = Forms!Formular1.Form.Formular2Container.Top + 1200
  59.  
  60. Forms!Formular1.Form.Formular2Container.Form.Formular3Container.Height = ContainerForm3Height - ContainerForm3Top
  61. Forms!Formular1.Form.Formular2Container.Form.Formular3Container.Width = ContainerForm3Width
  62. Forms!Formular1.Form.Formular2Container.Form.Formular3Container.Left = (ContainerForm2Width - ContainerForm3Width) / 2.5
  63. Forms!Formular1.Form.Formular2Container.Form.Formular3Container.Top = ContainerForm3Top
  64. End Function
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement