If Form.Width/Form.Height=3/4 Then...
If it's bigger, it's not a normal portrait screen (QVGA,VGA)
Now if your application also works in landscape:
You could try something like that (please note the top and bottom bars are not counted when getting Form.Height. Thus a 320 pixels screen height will return 268. Each bar is 26 pixels high on QVGA screens or 52 pixels high on VGA screens.)
If Form.Width>Form.Height Then
If Form.Width/Form.Height=240/268 Then
[I]ScreenFormat=VGA or QVGA (portrait)[/I]
End If
Else If Form.Width<Form.Height Then
If Form.Width/Form.Height=320/188 Then
[I]ScreenFormat=VGA or QVGA (landscape)[/I]
End If
Else If Form.Width/Form.Height=240/188 Then
[I]Screenformat="Square screen"[/I]
Else
[I]Screenformat="Other"[/I]
End If
Once you discover the size of the form, you can use Form.Height and Form.Width to align controls.
Control.Top=Form.Height-Control.Height
will align your control to the bottom of the screen, for example.