471,321 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,321 software developers and data experts.

Bug: ShowDialog + Large Fonts

Yesterday was getting very fed up trying to run a program
which works fine on my desktop machine (XP Pro)
but as soon as I put it on a laptop, I was getting an Exception,
which killed the program.

The problem occured when showing a dialog box a second time.
The first time it was hidden when closed, and when ShowDialog was
called a second time an InvalidOperationException was thrown,
claiming that a dialog could not be shown if it was already visible
(Which it wasn't!).

The exe and dll's were being run straight of a memory
card so I was definitley running the same version.

I checked that both computers had the same build of the .NET Framework,
which they did.

I started suspecting cache problems, which after much searching
around.... it wasn't....

This morning I noticed that the dialog looked quite different on the
two machines, and suddenly realised that Large Fonts was enabled on the
Laptop, where as my desktop the fonts were set to Normal. (This is a
setting under Control Panel/ Display / Settings / Advanced / General)

By setting the fonts back to normal the exception did not occur!

A work around for this is to use dialogObject.visible = true;
as opposed to ShowDialog, and this seems to work for both normal and
large fonts.

Note that if the dialog is recreated instead of just being hidden then
this problem will not occur.

Hope that helps someone.
TheinvisibleGhost

Nov 17 '05 #1
0 1013

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Neil Zanella | last post: by
reply views Thread by Programatix | last post: by
reply views Thread by Programatix | last post: by
2 posts views Thread by Ron Sellers | last post: by
5 posts views Thread by Alex Glass | last post: by
57 posts views Thread by Chris Tomlinson | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.