I am trying to test for the width of the current layout based on orientation. When I use the following code, I get different results than expected.
layoutVal = GetDeviceLayoutValues
If layoutVal.Width = 480 Then
...
Else If layoutVal.Width = 800 Then
...
End If
The dimensions of the views, according to the designer, are 320x480 and 480x320, but when I use layoutVal.Width with this code, the width for the vertical orientation is 800, and the width for the horizontal orientation is 480. How do I test for the actual layout dimensions being used?
--
layoutVal = GetDeviceLayoutValues
If layoutVal.Width = 480 Then
...
Else If layoutVal.Width = 800 Then
...
End If
The dimensions of the views, according to the designer, are 320x480 and 480x320, but when I use layoutVal.Width with this code, the width for the vertical orientation is 800, and the width for the horizontal orientation is 480. How do I test for the actual layout dimensions being used?
--