468,765 Members | 1,068 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

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.

Nov 17 '05 #1
0 939

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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.