ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Placing buttons etc on userform (https://www.excelbanter.com/excel-programming/366439-placing-buttons-etc-userform.html)

Gert-Jan

Placing buttons etc on userform
 
With this macro I set my userform to maximum screensinze.

Sub UserForm_Initialize()
With Application
Me.Top = .Top
Me.Left = .Left
Me.Height = .Height
Me.Width = .Width
End With
End Sub

In the footer of the userform I would like to place some bittons / remarks
and tried this code:

Private Sub UserForm_Activate()
CommandButton1.Top = UserForm1.Height - 20
End Sub

But, this will not work. Someone have an idea?

Gert-Jan



Ardus Petus

Placing buttons etc on userform
 
Try:
CommandButton1.Top = Me.top + Me.Height - 20

HTH
--
AP

"Gert-Jan" a écrit dans le message de news:
...
With this macro I set my userform to maximum screensinze.

Sub UserForm_Initialize()
With Application
Me.Top = .Top
Me.Left = .Left
Me.Height = .Height
Me.Width = .Width
End With
End Sub

In the footer of the userform I would like to place some bittons / remarks
and tried this code:

Private Sub UserForm_Activate()
CommandButton1.Top = UserForm1.Height - 20
End Sub

But, this will not work. Someone have an idea?

Gert-Jan




Gert-Jan

Placing buttons etc on userform
 
Thanks, this works (-20 isn't enough, you need -60 at least.)

"Ardus Petus" schreef in bericht
...
Try:
CommandButton1.Top = Me.top + Me.Height - 20

HTH
--
AP

"Gert-Jan" a écrit dans le message de news:
...
With this macro I set my userform to maximum screensinze.

Sub UserForm_Initialize()
With Application
Me.Top = .Top
Me.Left = .Left
Me.Height = .Height
Me.Width = .Width
End With
End Sub

In the footer of the userform I would like to place some bittons /
remarks and tried this code:

Private Sub UserForm_Activate()
CommandButton1.Top = UserForm1.Height - 20
End Sub

But, this will not work. Someone have an idea?

Gert-Jan







All times are GMT +1. The time now is 02:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com