Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Determine Form Location on a Form

Status
Not open for further replies.

LadyDev

Programmer
Jan 29, 2003
86
US
I don't know if I am wording this correctly, but this is the situation. I have a popup form that pops-up in the middle of a form. How can I get the popup form to appear in a specific location on the form; for instance, the bottom right hand corner of the form? Website? Previous thread dealing with situation? Or does anyone know?

Thanks
 
Typed in "Coordinates" in Help, got
The following example uses the Print method to display text on a report named Report1. It uses the TextWidth and TextHeight methods to center the text vertically and horizontally.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim rpt as Report
Dim strMessage As String
Dim intHorSize As Integer, intVerSize As Integer

Set rpt = Me
strMessage = "DisplayMessage"
With rpt
'Set scale to pixels, and set FontName and FontSize properties.
.ScaleMode = 3
.FontName = "Courier"
.FontSize = 24
End With
' Horizontal width.
intHorSize = Rpt.TextWidth(strMessage)
' Vertical height.
intVerSize = Rpt.TextHeight(strMessage)

' Calculate location of text to be displayed.
Rpt.CurrentX = (Rpt.ScaleWidth/2) - (intHorSize/2)
Rpt.CurrentY = (Rpt.ScaleHeight/2) - (intVerSize/2)
' Print text on Report object.
Rpt.Print strMessage
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top