Propiedad Form.InsideHeight (Access)

Utilice la propiedad InsideHeight (junto con la propiedad InsideWidth ) para determinar el alto y el ancho (en twips) de la ventana que contiene un formulario. Long de lectura y escritura.

Sintaxis

expresión. InsideHeight

expresión Variable que representa un objeto Form.

Comentarios

Si desea determinar las dimensiones interiores del propio formulario, use la propiedad Width para determinar el ancho del formulario y la suma de los altos de las secciones visibles del formulario para determinar su alto (la propiedad Height solo se aplica a las secciones del formulario, no a los formularios). El interior de un formulario es la zona dentro del formulario, sin incluir las barras de desplazamiento y los selectores de registros.

También puede usar las propiedades WindowHeight y WindowWidth para determinar el alto y el ancho de la ventana que contiene un formulario.

Si una ventana está maximizada, establecer estas propiedades no tiene ningún efecto hasta que la ventana se haya restaurado a su tamaño normal.

Ejemplo:

En el ejemplo siguiente se muestra cómo usar las propiedades InsideHeight e InsideWidth para comparar el alto interior y el ancho de un formulario con el alto y el ancho de la ventana del formulario. Si las dimensiones de la ventana no son iguales al tamaño del formulario, se cambia el tamaño de la ventana para que coincida con el alto y el ancho del formulario.

Sub ResetWindowSize(frm As Form) 
 Dim intWindowHeight As Integer 
 Dim intWindowWidth As Integer 
 Dim intTotalFormHeight As Integer 
 Dim intTotalFormWidth As Integer 
 Dim intHeightHeader As Integer 
 Dim intHeightDetail As Integer 
 Dim intHeightFooter As Integer 
 
 ' Determine form's height. 
 intHeightHeader = frm.Section(acHeader).Height 
 intHeightDetail = frm.Section(acDetail).Height 
 intHeightFooter = frm.Section(acFooter).Height 
 intTotalFormHeight = intHeightHeader _ 
 + intHeightDetail + intHeightFooter 
 ' Determine form's width. 
 intTotalFormWidth = frm.Width 
 ' Determine window's height and width. 
 intWindowHeight = frm.InsideHeight 
 intWindowWidth = frm.InsideWidth 
 
 If intWindowWidth <> intTotalFormWidth Then 
 frm.InsideWidth = intTotalFormWidth 
 End If 
 If intWindowHeight <> intTotalFormHeight Then 
 frm.InsideHeight = intTotalFormHeight 
 End If 
End Sub

Soporte técnico y comentarios

¿Tiene preguntas o comentarios sobre VBA para Office o esta documentación? Vea Soporte técnico y comentarios sobre VBA para Office para obtener ayuda sobre las formas en las que puede recibir soporte técnico y enviar comentarios.