making fonts size fixed

G

Guest

Hello,
I have a project with windows forms. The size of the forms is fixed, and the
text in the form is made to fit exactly in the form. The problem is that if
the user changes the font size in windows, the form itself doesn't change its
size but the text becomes bigger, and only part of it is seen. Is there
anyway to make the text remain in the same size always, regardless of the
font size of windows?

thanks,
 
M

Michael Nemtsev

Hello dshemesh,

Why not tot use AutoScale for the controls, or override the Control.ScaleCore
for your cases?

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

d> Hello,
d> I have a project with windows forms. The size of the forms is fixed,
d> and the
d> text in the form is made to fit exactly in the form. The problem is
d> that if
d> the user changes the font size in windows, the form itself doesn't
d> change its
d> size but the text becomes bigger, and only part of it is seen. Is
d> there
d> anyway to make the text remain in the same size always, regardless of
d> the
d> font size of windows?
d> thanks,
d>
 
G

Guest

I'm not sure what these things do. If AutoScale changes the size of the form
it's not good for me. I really need the forms to have a fixed size.
What does Control.ScaleCore do?
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

dshemesh said:
Hello,
I have a project with windows forms. The size of the forms is fixed, and
the
text in the form is made to fit exactly in the form. The problem is that
if
the user changes the font size in windows, the form itself doesn't change
its
size but the text becomes bigger, and only part of it is seen. Is there
anyway to make the text remain in the same size always, regardless of the
font size of windows?

I think that is the incorrect approach, the correct approach is how to
modify my program in such a way that the user can modify the fonts and my
program adapt to the new form.

You can use MeasureString to know how many space a given text will occupy ,
so you can modify your form to show the entire text.
 
P

Peter Duniho

[...] The problem is that if
the user changes the font size in windows, the form itself doesn't
change its
size but the text becomes bigger, and only part of it is seen. Is there
anyway to make the text remain in the same size always, regardless of the
font size of windows?

If the user has changed the screen resolution or font size in Windows,
they did so for a good reason. If you insist on preventing that setting
from having effect (even if you could), you may very well render your
application unusable to the user.

Between the suggestions from Michael and Ignacio, you should be able to
come up with a solution in which your application is usable regardless of
the way the user has configured their Windows computer.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top