P
Phill W.
From what I've been reading, the code below /should/ pop up the Users
chosen Font Size (yes; I'm having to cross sword with "Large Fonts" some
... person .. decided to recommend it to our users).
Private Declare Function apiGetDeviceCaps Lib "gdi32.dll" _
Alias "GetDeviceCaps" ( _
ByVal hdc As IntPtr _
, ByVal iIndex As Integer _
) As Integer
Private Const LOGPIXELSX As Integer = 88
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
MyBase.OnLoad(e)
Dim g As Graphics = Me.CreateGraphics()
Dim ip As IntPtr = g.GetHdc()
Dim i As Integer = apiGetDeviceCaps(ip, LOGPIXELSX)
g.ReleaseHdc(ip)
g.Dispose()
MsgBox(i)
End Sub
Lovely - except that it always seems to return 96, no matter what Font
Size I've selected in Control Panel.
Any suggestions?
TIA,
Phill W.
chosen Font Size (yes; I'm having to cross sword with "Large Fonts" some
... person .. decided to recommend it to our users).
Private Declare Function apiGetDeviceCaps Lib "gdi32.dll" _
Alias "GetDeviceCaps" ( _
ByVal hdc As IntPtr _
, ByVal iIndex As Integer _
) As Integer
Private Const LOGPIXELSX As Integer = 88
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
MyBase.OnLoad(e)
Dim g As Graphics = Me.CreateGraphics()
Dim ip As IntPtr = g.GetHdc()
Dim i As Integer = apiGetDeviceCaps(ip, LOGPIXELSX)
g.ReleaseHdc(ip)
g.Dispose()
MsgBox(i)
End Sub
Lovely - except that it always seems to return 96, no matter what Font
Size I've selected in Control Panel.
Any suggestions?
TIA,
Phill W.