PDA

View Full Version : Move Button on Outllook Form



pjawynn
06-21-2015, 02:13 AM
Good Morning back again,

Could someone suggest the way to move the location of a macro button. I have a button located on a form which is covering over a label and a text box which are not visible. Depending on which option is selected the label and text box become visible which means that I need to move the button down the form.

The button is names "Submitbut" and I have tried Submitbut.Move 1134,13608,0,0 (This is on the principle that 1cm = 567 twips)

I have tried other but the button just disappears.

------------------------

Private Sub PermitTypeComboBox_Change()
Dim YearPermitEndDate As Date
Dim SixMonthPermitEndDate As Date
'Dim EndYear As Date
'Dim MidYear As Date


'EndYear = "31/08/" & Year(Date)
'MidYear = "31/03/" & Year(Date)


'YearPermitEndDate = DateAdd("yyyy", 1, EndYear)
'SixMonthPermitEndDate = DateAdd("yyyy", 1, MidYear)


YearPermitEndDate = "31/08/2016"
SixMonthPermitEndDate = "31/03/2016"




If PermitTypeComboBox.Text = "Yearly Permit" Then
PermitEndDateComboBox.Text = YearPermitEndDate
PermitEndlbl.Visible = False
PermitEndDateComboBox.Visible = False


ElseIf PermitTypeComboBox.Text = "6 Month Permit" Then
With PermitEndDateComboBox
.AddItem SixMonthPermitEndDate
.AddItem YearPermitEndDate
End With
PermitEndlbl.Visible = True
PermitEndDateComboBox.Visible = True
Submitbut.Move 1134, 13608, 0, 0


End If
End Sub
---------------------------

Thank you

Pjawynn

SamT
06-21-2015, 08:19 AM
For a form or control
object.Move( [Left [, Top [, Width [, Height [, Layout]]]]])

The Move method syntax has these parts:


Part
Description


object
Required. A valid object name.


Left
Optional. Single-precision value, in points, indicating the horizontal coordinate for the left edge of the object.


Top
Optional. Single-precision value, in points, that specifies the vertical coordinate for the top edge of the object.

point

A point is 1/72 inch. Font sizes are usually measured in points.







Const OldSubmitTop as Single = nnn
Const OldSubmitLeft As Single = nnn
'
'
'Move to new Position
Submitbut.Move(Top:=OldSubmitTop + 144, Left:=OldSubmitLeft + 90)
'144 = 2", 90 = 1 1/4"

'Move to original position
Submitbut.Move(Top:=OldSubmitTop, Left:=OldSubmitLeft)