I've created a program in C#, which includes several Forms. some of the forms
are in different size, but i start all of them in Window Normal Size.
I took the exe file from the \bin\debug library and started it on my
computer and all the forms where at the same size as i programed it to be.
then i took it to my friend's PC and it worked fine too (we both have NVIDIA
display card), then i took it to another computer (with different display
card) and there the form where not at the same size as i programmed. Some
were too big (came out of the screen's border). Is it possible that different
display cards make the forms to be displayed differntly? I asked some
friends, and they told me that C# suppose to know how to handle such things
automaticly.
What can I do, to fix this problem? because i want to put my program on
several PCs and i don't know which display card they'll have.
Thanks,
Gidi. 9 8741
The size of a window is measured in pixels. Different computers have
different screen resolutions. You would need to get the pixel size of the
screen and resize the form accordingly in order to do this.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
"Gidi" <sh*****@hotmai l.com.dontspam> wrote in message
news:47******** *************** ***********@mic rosoft.com... I've created a program in C#, which includes several Forms. some of the forms are in different size, but i start all of them in Window Normal Size. I took the exe file from the \bin\debug library and started it on my computer and all the forms where at the same size as i programed it to be. then i took it to my friend's PC and it worked fine too (we both have NVIDIA display card), then i took it to another computer (with different display card) and there the form where not at the same size as i programmed. Some were too big (came out of the screen's border). Is it possible that different display cards make the forms to be displayed differntly? I asked some friends, and they told me that C# suppose to know how to handle such things automaticly. What can I do, to fix this problem? because i want to put my program on several PCs and i don't know which display card they'll have.
Thanks, Gidi.
thanks Kevin,
even when i changed the resolution of the problematic screen to same as
mine, it still didn't work well.
"Kevin Spencer" wrote: The size of a window is measured in pixels. Different computers have different screen resolutions. You would need to get the pixel size of the screen and resize the form accordingly in order to do this.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer You can lead a fish to a bicycle, but you can't make it stink.
"Gidi" <sh*****@hotmai l.com.dontspam> wrote in message news:47******** *************** ***********@mic rosoft.com... I've created a program in C#, which includes several Forms. some of the forms are in different size, but i start all of them in Window Normal Size. I took the exe file from the \bin\debug library and started it on my computer and all the forms where at the same size as i programed it to be. then i took it to my friend's PC and it worked fine too (we both have NVIDIA display card), then i took it to another computer (with different display card) and there the form where not at the same size as i programmed. Some were too big (came out of the screen's border). Is it possible that different display cards make the forms to be displayed differntly? I asked some friends, and they told me that C# suppose to know how to handle such things automaticly. What can I do, to fix this problem? because i want to put my program on several PCs and i don't know which display card they'll have.
Thanks, Gidi.
This might be overkill, but I set the Dock property to most of the controls
on my form. In my opinion, it is much more dynamic, flexible, and automated
than trying to handle resize events. Usually, I dock everything to the top
and/or bottom of a form and set the app's main workspace to Fill. If I don't
want a control, like a button or textbox, to stretch the entire width of
the control, I group these controls in Panels and set Panel.Dock. In my opinion,
docking is much more powerful than Anchor because it ensures that controls
stay adjacent to other controls.
You should also play with .NET 2.0 flow layout panel. thanks Kevin, even when i changed the resolution of the problematic screen to same as mine, it still didn't work well. "Kevin Spencer" wrote:
The size of a window is measured in pixels. Different computers have different screen resolutions. You would need to get the pixel size of the screen and resize the form accordingly in order to do this.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer You can lead a fish to a bicycle, but you can't make it stink. "Gidi" <sh*****@hotmai l.com.dontspam> wrote in message news:47******** *************** ***********@mic rosoft.com...
I've created a program in C#, which includes several Forms. some of the forms are in different size, but i start all of them in Window Normal Size. I took the exe file from the \bin\debug library and started it on my computer and all the forms where at the same size as i programed it to be. then i took it to my friend's PC and it worked fine too (we both have NVIDIA display card), then i took it to another computer (with different display card) and there the form where not at the same size as i programmed. Some were too big (came out of the screen's border). Is it possible that different display cards make the forms to be displayed differntly? I asked some friends, and they told me that C# suppose to know how to handle such things automaticly. What can I do, to fix this problem? because i want to put my program on several PCs and i don't know which display card they'll have. Thanks, Gidi.
Probably your friend increased the font size in his appearnce settings
of the desktop, that has sometimes weird effects on statically designed
windows as buttons become too small and so forth.
"jo*******@gmx. de" wrote: Probably your friend increased the font size in his appearnce settings of the desktop, that has sometimes weird effects on statically designed windows as buttons become too small and so forth.
I just tried this. The forms title bar grew, but the other controls (label,
button, checkbox) were completely unaffected. The title bar grew "up" so it
didn't cause problems by pushing controls down off the bottom of the form
either.
Dan Neely wrote: "jo*******@gmx. de" wrote:
Probably your friend increased the font size in his appearnce settings of the desktop, that has sometimes weird effects on statically designed windows as buttons become too small and so forth.
I just tried this. The forms title bar grew, but the other controls (label, button, checkbox) were completely unaffected. The title bar grew "up" so it didn't cause problems by pushing controls down off the bottom of the form either.
Do not change the font size in appearance settings, instead go to
Settings->Advanced and change DPI Setting. This is the setting that has
weird consequences for values other than 96.
Also see the documentation for the AutoScale (1.1) and AutoScaleMode
(2.0) properties.
HTH,
Stefan
Thanks Stefan,
I changed the DPI and it fixed the problem.
"Stefan Simek" wrote: Dan Neely wrote: "jo*******@gmx. de" wrote:
Probably your friend increased the font size in his appearnce settings of the desktop, that has sometimes weird effects on statically designed windows as buttons become too small and so forth.
I just tried this. The forms title bar grew, but the other controls (label, button, checkbox) were completely unaffected. The title bar grew "up" so it didn't cause problems by pushing controls down off the bottom of the form either.
Do not change the font size in appearance settings, instead go to Settings->Advanced and change DPI Setting. This is the setting that has weird consequences for values other than 96.
Also see the documentation for the AutoScale (1.1) and AutoScaleMode (2.0) properties.
HTH, Stefan
Try this code
this.AutoScaleD imensions = new
System.Drawing. SizeF(this.Curr entAutoScaleDim ensions.Width,
this.CurrentAut oScaleDimension s.Height);
this.FormBorder Style = this.AutoSize = false;
System.Windows. Forms.FormBorde rStyle.FixedSin gle;
*** Sent via Developersdex http://www.developersdex.com *** This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Bryan |
last post by:
I have this function below
function checkLength(field, nextField)
{
var letters = document.form1.elements.value.length +1;
if (letters <= 2)
{document.form1.elements.focus()}
else
{document.form1.elements.focus()}
}
|
by: Roger |
last post by:
Hi All,
I have an app where I change the size of the form at run time using controls
and I do not want the user to be able to resize the form, I have removed the
min and max buttons. I have tried to set the min and max size to what I want
but now the form will not resize when they should be, it looks like I could
change the min and max size everytime I want to resize the form but this
seems a little cumbersome - - any easy way of doing...
|
by: Rodrigo Ferreira |
last post by:
In my project i create a form in runtime when i click in a button.
The problem consists in the form size. I put this lines:
frmCalculadora.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
frmCalculadora.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
frmCalculadora.ClientSize = new System.Drawing.Size(160, 16);
But the form doesn't appear with this height. The width is correct but the height not!
|
by: Woody Splawn |
last post by:
I don't mean to be too wordy but if you will indulge me a moment I need to
get something clear in my mind. I am concerned about the size of my forms.
I am concerned that if I put too much code in them they may run slow. These
are winforms, nothing to do with the net. In the enviroment I came from
(PowerBuilder) if your form got too big because of code, you just shuffled
off some of it into what VS thinks of as a module. I will do the...
|
by: Galen Somerville |
last post by:
My current screen resolution is set to 1024 x 768. My form size always comes
up as 1032 x 748.
I have tried the help sample
' Retrieve the working rectangle from the Screen class
' using the PrimaryScreen and the WorkingArea properties.
Dim workingRectangle As System.Drawing.Rectangle = _
Screen.PrimaryScreen.WorkingArea
' Set the size of the form slightly less than size of
| |
by: greg.merideth |
last post by:
I inherited a vs2003 project which I've converted into vs2005 to run
under .net 2.0. The conversion was fine and the project compiles and
runs just fine until today. A user called me up asking why they cannot
see the bottom of the form anymore (it's a fixed height form).
I opened the project again and looked at the form and sure enough, it's
exactly 180 pixels less than it used to be. Thinking I messed up, I
fixed the form, recompiled...
|
by: linux_bp |
last post by:
I had deleted my object files accidently. Now to analyse a core i need
object files. If I recompile the same source code with imake on
solaris, i m getting the binary of different size. Is it because of
different compilation date and time?
|
by: =?Utf-8?B?VGVycnk=?= |
last post by:
Hope someone has some ideas - this is driving me nuts,
I am using VS2008 and have a tightly layed out form at 8 pts. The form
has a font dialog and when the user changes the font size, everything works
great. I go through the forms control collection (recurively) and everything
resizes as it should.
Ok, so the next step is to remember the font size selected by the user
and select it when the form is loaded. Woops - does not work! So, I...
|
by: madasamonkey |
last post by:
I'm using Visual Studio 2008. The o/s is Win XP Pro.
Here's my problem:
The machine I'm working on is a PC and the monitor resolution is 1280 x 1024
The target machine on which the app will run is a media centre PC hooked up to a 42inch LCD display, on which the screen res is 1360 x 768.
I want the form to fill the entire TV screen, but my attempts to increase the form size to do this are thwarted by Visual Studio. Each time I try to set...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |