Prikazi cijelu temu 21.06.2020 11:15
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Lokacija:Tuzla


Predmet:Re: Maximize Forme
PreuzmiIzvorni kôd (Visual Basic):
  1. Option Compare Database
  2. Dim x As Single, kx As Single, y As Single, ky As Single
  3. Private Sub Form_Load()
  4. x = Me.InsideWidth
  5. kx = Me.InsideWidth
  6. y = Me.InsideHeight
  7. ky = Me.InsideHeight
  8. End Sub
  9.  
  10. Private Sub Form_Resize()
  11. Dim DeltaX As Single, DeltaY As Single, xt As Single, yt As Single
  12. Dim ctl As Control
  13. Dim frm As Form
  14.  
  15. On Error Resume Next
  16. If Me.InsideWidth < kx Then: Me.InsideWidth = kx
  17. If Me.InsideHeight < ky Then: Me.InsideHeight = ky
  18. xt = Me.InsideWidth
  19. yt = Me.InsideHeight
  20.  
  21. DeltaX = (xt - x) / 2
  22. DeltaY = (yt - y) / 2
  23. Set frm = Me.Form
  24. For Each ctl In frm.Detail.Controls
  25.     ctl.Left = ctl.Left + DeltaX
  26.     ctl.Top = ctl.Top + DeltaY
  27. Next ctl
  28.  
  29. x = Me.InsideWidth
  30. y = Me.InsideHeight
  31. End Sub

Kopiraj ovaj kod u modul forme
Podrška samo putem foruma, jer samo tako i ostali imaju koristi od toga.