views:

41

answers:

0

I have been tasked with modifying an existing phone application to allow it to resize to multiple resolutions. I have it resizing fine by using the Scale function but i'm still finding that the fonts are far too small when run on a high resolution Windows CE device.

I am currently attempting to set the forms font to a larger size and recurse through all its children and their children setting their font property respectively and this works fine on the Windows Mobile 6 emulators but seems to have no affect at all on the Windows CE 6 device.

Is there a major difference in how this needs to be implemented between the operating systems?

My code so far:

Me.Scale(New SizeF(Me.Width / mSize.Width, Me.Height / mSize.Height))
SetFonts(Me, New Font(Me.Font.Name, Me.Font.Size * (Me.Height / mSize.Height), Me.Font.Style))

Where SetFonts is:

Private Sub SetFonts(ByRef parent As Control, ByVal font As Font)
    Try
        parent.Font = font
    Catch ex As Exception

    End Try

    For Each child As Control In parent.Controls
        SetFonts(child, font)
    Next
End Sub

And mSize is a Size structure which represents the previous size of the window. This code is in my window resize function, which runs initially when I set Me.WindowState = FormWindowState.Maximized. The try _catch_ is a bit of a hack for now just to get it to work as some child controls don't allow changing their font property - panels etc.