resoluci贸n de pantalla
hay forma de averiguar la resoluci贸n de pantalla de la computadora y hacer que se adapten los formularios a esta nueva resoluci贸n. tengo un formulario con varios textbox distribuidos en el mismo y se nota demasiado el cambio de resoluci贸n.
Puedes cambiar la resoluci贸n de tal manera que se adapte a tu programa
Public Sub resolucion()
\'Mostrar las resoluciones disponibles
Dim a As Boolean
Dim i As Long
i = 1
Do
a = EnumDisplaySettings(0&, i&, DevM)
i = i + 1
If a Then
\' \'Mostrar en el listbox las resoluciones disponibles
\' List1.AddItem Format$(DevM.dmPelsWidth, " @@@@") & " x " & _
\' Format$(DevM.dmPelsHeight, "@@@@") & " " & _
\' Format$(DevM.dmBitsPerPel, "@@") & " bits"
\'Guardar esos datos en nuestro array
\'de las resoluciones disponibles
ReDim Preserve Disponibles(i - 1)
With Disponibles(i - 1)
.Width = DevM.dmPelsWidth
.Height = DevM.dmPelsHeight
.Bits = DevM.dmBitsPerPel
End With
End If
Loop While a
\'Deshabilitar el bot贸n hasta que se seleccione algo
\'Command1.Enabled = False
i = 7
\'\'\' es la definicion de la lista y la de 640 que modifique yo con 24 colores!
DevM.dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT
\'Cambiar a la resoluci贸n indicada
With Disponibles(i)
DevM.dmPelsWidth = .Width
DevM.dmPelsHeight = .Height
DevM.dmBitsPerPel = .Bits
End With
Call ChangeDisplaySettings(DevM, 0)
End Sub
Espero que te sirva
Public Sub resolucion()
\'Mostrar las resoluciones disponibles
Dim a As Boolean
Dim i As Long
i = 1
Do
a = EnumDisplaySettings(0&, i&, DevM)
i = i + 1
If a Then
\' \'Mostrar en el listbox las resoluciones disponibles
\' List1.AddItem Format$(DevM.dmPelsWidth, " @@@@") & " x " & _
\' Format$(DevM.dmPelsHeight, "@@@@") & " " & _
\' Format$(DevM.dmBitsPerPel, "@@") & " bits"
\'Guardar esos datos en nuestro array
\'de las resoluciones disponibles
ReDim Preserve Disponibles(i - 1)
With Disponibles(i - 1)
.Width = DevM.dmPelsWidth
.Height = DevM.dmPelsHeight
.Bits = DevM.dmBitsPerPel
End With
End If
Loop While a
\'Deshabilitar el bot贸n hasta que se seleccione algo
\'Command1.Enabled = False
i = 7
\'\'\' es la definicion de la lista y la de 640 que modifique yo con 24 colores!
DevM.dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT
\'Cambiar a la resoluci贸n indicada
With Disponibles(i)
DevM.dmPelsWidth = .Width
DevM.dmPelsHeight = .Height
DevM.dmBitsPerPel = .Bits
End With
Call ChangeDisplaySettings(DevM, 0)
End Sub
Espero que te sirva
Don't change user's preferences ;-)
Retrieving screen resolution:
MsgBox Screen.Width / Screen.TwipsPerPixelX & " pixels"
MsgBox Screen.Height / Screen.TwipsPerPixelY & " pixels"
Also:
How To Create a Resolution-Independent Form example:
http://support.microsoft.com/default.aspx?scid=kb;en-us;182070
Retrieving screen resolution:
MsgBox Screen.Width / Screen.TwipsPerPixelX & " pixels"
MsgBox Screen.Height / Screen.TwipsPerPixelY & " pixels"
Also:
How To Create a Resolution-Independent Form example:
http://support.microsoft.com/default.aspx?scid=kb;en-us;182070
