Link to home
Start Free TrialLog in
Avatar of webmanager
webmanagerFlag for Canada

asked on

800x600 app displaying at 1000x750

for some reason, this app that I built displays fine on 10 machines that I tested it on.

However, when I run it on this one machine, it runs at 1000x750!!!

Any ideas?
Avatar of Mike McCracken
Mike McCracken

Is the machine set to run at that resolution (1000 x 750)?

The VB application will run at the resolution of the machine it is on.  Unless you wrote special code to change the machine resolution, the applicatiion will not change the machine resolution.

mlmcc
Another thing that affect appearant resolution is the use of Large Fonts.  If this is selected in the Display Settings, then even if the resolution is set to 800X600, the windows will appear on screen as if the user were in 640X480 mode.

That's sort of the opposite of your problem, unless those 10 machines have Large Font selected and this one machine does not (and all computers are really set in 1000X750 mode).
You can also choose small fonts and in some cases set your own % increase or decrease.

mlmcc
Avatar of webmanager

ASKER

I have tested the app in 1024x768......1280x1024.....1600x1200...  it never resized on any machine......it was always 800x600.....  it's just on that one machine.  He's running at 1280x1024....
oh...  it doesn't resize the screen resolution.....  I built the form to be 800x600..  it's just a window..
What do you mean the app resizes?

mlmcc
ok....

apparently this person has "large fonts" enabled...which is causing the problem.  Is there a way in VB to program an app to use "small fonts"?
None that I know of.  We have a similar problem with som eof our users.  Most use the default - normal fonts at 800x600 or 640x480.  Some have large (>20") monitors and use 1024x768 or larger with large fonts.  

We had two choices
1.  If a user wanted to use our app they would have to resize their resoultion to at most 800x600

2.  We could add a resizer on the form and set a maximum and minimum size for each form which was set on form load.

We chose 2 - a lot of work on our part but more convenient to the users.

good luck
mlmcc
Ahem... didn't I mention the large fonts a few days ago ;)

I don't think you could or should, try to change a person's display settings in a application.  I know that there is a way to tell, but it requires some calculation.  See, the resolution stays high, but the number of characters that can fit on the screen is drastically reduced, so, if you get the textmetrics and do some calculations with the screen width, you can usually tell.  Then, once you know you're in Large Font mode, you might size your screen differently or use a different set of graphics.

Personally, we most often adopt the position that we support specific display properties, and if someone is using something outside of that, well, they can suffer the consequences.
After the trouble we had with our application to get it to resize, future applicatiions will probably be built to a specific resolution and users will have to adjust.

One thing I would recommend would be to have either a close X on the top or a close button that can be reached with the TAB key so  auser doesn't get trapped .

good luck
mlmcc
In looking through old mail I found a link to a PAQ that suggested looking at the following link.

http://www.lyoung.com/ 

the PAQ is at

https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20253517


good luck
mlmcc
ASKER CERTIFIED SOLUTION
Avatar of mdougan
mdougan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I appreciate all your help....  I have finally convinced the user to change their font size when displaying the app to clients.

lol....took a long time to convince him.
Great!  So, this answers your original question?
mdougan
WIll the code or similar code work for Win 2K?

mlmcc
As far as I know, it should work fine.  I know of no changes in W2K that should affect it.
'code for adjusting to any screen area
' place any five controls into the form
' copy the code into module

Option Explicit
Type ControlProportions
    WidthProportion As Single
    HeightProportion As Single
    TopProportion As Single
    LeftProportion  As Single
End Type
Dim ArrayProportions() As ControlProportions

'Function for Storing the properties of control of form
Public Function CallProportion(My As Form)
    ReDim ArrayProportions(0 To My.Controls.Count - 1)
    MsgBox ("No. of Controls in form = " & My.Controls.Count)
    Dim I As Integer
    On Error Resume Next
   
    For I = 0 To My.Controls.Count - 1  'UBound(ArrayProportions)
        If TypeOf My.Controls(I) Is Timer Then
            ' Do Nothing
        ElseIf TypeOf My.Controls(I) Is ComboBox Then 'CommonDialog Then
            ' Do Nothing
            With ArrayProportions(I)
                .WidthProportion = My.Controls(I).Width / My.ScaleWidth
                .HeightProportion = My.Controls(I).Height / My.ScaleHeight
                .LeftProportion = My.Controls(I).Left / My.ScaleWidth
                .TopProportion = My.Controls(I).Top / My.ScaleHeight
            End With
        Else
            With ArrayProportions(I)
                .WidthProportion = My.Controls(I).Width / My.ScaleWidth
                .HeightProportion = My.Controls(I).Height / My.ScaleHeight
                .LeftProportion = My.Controls(I).Left / My.ScaleWidth
                .TopProportion = My.Controls(I).Top / My.ScaleHeight
            End With
        End If
    Next
End Function

Public Function ReCallProportion(My As Form)
    Dim I As Integer
    'MsgBox "From ReCallProportion  " & My.ScaleHeight
    For I = 0 To My.Controls.Count - 1
        If TypeOf My.Controls(I) Is Timer Then
            ' Do Nothing
        ElseIf TypeOf My.Controls(I) Is ComboBox Then ' CommonDialog Then
            ' Do Nothing
             My.Controls(I).Move ArrayProportions(I).LeftProportion * _
                My.ScaleWidth, _
                ArrayProportions(I).TopProportion * My.ScaleHeight, _
                ArrayProportions(I).WidthProportion * My.ScaleWidth ', _
               ' ArrayProportions(I).HeightProportion '* My.ScaleHeight
        Else
            My.Controls(I).Move ArrayProportions(I).LeftProportion * _
                My.ScaleWidth, _
                ArrayProportions(I).TopProportion * My.ScaleHeight, _
                ArrayProportions(I).WidthProportion * My.ScaleWidth, _
                ArrayProportions(I).HeightProportion * My.ScaleHeight
        End If
    Next
End Function

Public Sub ToCode()
    MsgBox ("From code module")
End Sub

Public Function MyCall(My As Form)
     My.Print "From Code Module"
End Function


' write a following code into a foem

Private Sub Command1_Click()
    Call ToCode
    Call MyCall(Me)
End Sub

Private Sub Form_Load()
'    Show
    Call CallProportion(Me)
End Sub

Public Sub Form_Resize()
    Call ReCallProportion(Me)
End Sub
mgrover30,

I can see that you're new to EE.  The custom here is to post all proposed solutions as comments.  Then, after some dialog with the questioner, if the questioner is satisifed that your comment solved their problem then they will accept your comment as an answer.

By proposing your solution as an Answer, you Lock the question, which moves it to a list that hardly any Experts ever look at, which means that you have made it doubtful that webmanager is going to get any new help on this question unless he rejects your solution.
if I reject this answer now, can I accept it as an answer later?
Yes, and if not, you could always ask mgrover30 to resubmit it as an answer again.
However, what else are you waiting for?
Hello?
I havn't had time to try this out....  I should have some time mid next week...   sorry for the delay....
This question appears to have been abandoned. A Moderator will be asked to
close this question after seven days, with the following recommended
disposition:

Points to mdougan

If you have any comment or objection to the recommendation, please leave it here.

guidway
EE Cleanup Volunteer
Per recommendation, force-accepted.

Netminder
CS Moderator