2009-08-27 14 views

Respuesta

13

que puede utilizar:

My.Computer.Screen.Bounds 

o:

Screen.PrimaryScreen.Bounds 

Bounds es un rectángulo que proporciona el tamaño. Alternativamente, se puede ver en la WorkingArea, que no incluirá la barra de tareas y ventanas acopladas.

+0

Así, por ejemplo, la parte inferior derecha, lo ¿Podría ser? – Cyclone

+0

¡No importa, lo tengo! ¡GRACIAS! – Cyclone

0

para WPF puede utilizar:

System.Windows.SystemParameters.PrimaryScreenWidth 

System.Windows.SystemParameters.PrimaryScreenHeight 
1

Usted puede usar algo como:

My.Computer.Screen.Bounds.Size.Width 
My.Computer.Screen.Bounds.Size.Height 
-1

Inserta este código en Form_Load. Puse algunas resoluciones ...

Dim dw As Double 
    Dim dh as Double 


    Width = Screen.PrimaryScreen.Bounds.Width 
    If (Width = 1366) Then 
     dw = 1 
    ElseIf (Width = 1920) Then 
     dw = 1.4055 
    ElseIf (Width = 1280) Then 
     dw = 0.9379 
    End If 

    For Each c As Control In Me.Controls 
     c.Width = CInt(CDbl(c.Width * dw)) 
    Next 

    Height = My.Computer.Screen.Bounds.Size.Height 
    If (Height = 768) Then 
     dh = 1 
    ElseIf (Height = 1080) Then 
     dh = 1.4062 
    ElseIf (Height = 1024) Then 
     dh = 1.3333 
    End If 

    For Each g As Control In Me.Controls 
     g.Height = CInt(CDbl(g.Height * dh)) 
    Next 
+0

considera agregar una explicación a tu código – arghtype

0

tenue altura como entero = Screen.PrimaryScreen.Bounds.Height tenue ancho como entero = Screen.PrimaryScreen.Bounds.Width

Cuestiones relacionadas