Windows Develop Bookmark and Share   
 index > Windows Forms General > Couple of questions reguarding Windows Forms Appications (.NET 2.0, C++, VS2005)
 

Couple of questions reguarding Windows Forms Appications (.NET 2.0, C++, VS2005)

Hey guys, Ive been developing a program to do some number crunching for a game I play and ran into a few issues when I released it to the playerbase.

Firstly, people with custom Windows themes (that changed default text size and such) couldnt read the text on my program cause the the size made it unreadable. Is there a way to fix the text size on the program so it will be the same on all computers?

Secondly, people who were using it forigen countries would get fatal errors on install (I used the setup project on VS2005) and couldn't proceed. This was only fixed when they changed the default language setting for Windows from their lanugage (One guy was sweedish) to English (US), then it worked fine. Is there a way to get my program to install and run on their computers without them having to change the language settings?

Lee3305  Wednesday, January 30, 2008 12:20 AM

Anyone?
Lee3305  Thursday, January 31, 2008 6:55 PM

Hi, Lee3305,

Based on my understanding, you want to know1) how to keep the text size of your application, 2) how to remove the fatal errors, don't you?

For your first question,the Text will change its size automatically is because a feature in ,NetWindows Applicatons.

It is called "Automatic Scaling"

Here is a detailed article.

http://msdn2.microsoft.com/en-us/library/ms229605.aspx

To get rid of this behavior, you should change the AutoScaleMode of your form to none.

http://msdn2.microsoft.com/en-us/library/system.windows.forms.autoscalemode.aspx

And for your second problem, I guess it is because the bootstrapper cannot install the correct .Net Framework in your client machine. So please provide them a special version of windows installer to install the application.

Please check this article for more details.

http://msdn2.microsoft.com/en-us/library/xhz1cfs8.aspx

Hope this helps,

Regards

Yu Guo â€?MSFT  Friday, February 01, 2008 6:36 AM
Yu Guo �MSFT wrote:

Hi, Lee3305,

Based on my understanding, you want to know1) how to keep the text size of your application, 2) how to remove the fatal errors, don't you?

For your first question,the Text will change its size automatically is because a feature in ,NetWindows Applicatons.

It is called "Automatic Scaling"

Here is a detailed article.

http://msdn2.microsoft.com/en-us/library/ms229605.aspx

To get rid of this behavior, you should change the AutoScaleMode of your form to none.

http://msdn2.microsoft.com/en-us/library/system.windows.forms.autoscalemode.aspx

And for your second problem, I guess it is because the bootstrapper cannot install the correct .Net Framework in your client machine. So please provide them a special version of windows installer to install the application.

Please check this article for more details.

http://msdn2.microsoft.com/en-us/library/xhz1cfs8.aspx

Hope this helps,

Regards

Thanks for the anwser on the AutoScaling problem ... but Im not sure if we are talking about the same problem for the installation error. It runs fine on my machine and on everyone whos downloaded it that lives in the US, but when my UK and Swedish friends downloaded it they got the error. They said it would properly install when they changed their language settings from whatever their langauge was to English. Any way to fix this without them having to maually set their language to English?

Lee3305  Friday, February 01, 2008 9:27 AM

Hi, Lee3305,

Could you providesome detailed error logs?

Regards

Yu Guo â€?MSFT  Saturday, February 02, 2008 2:15 AM

Code Snippet
Get a error msg which says "An unhandled exeception ('system.formatExeption'http://forums.station.sony.com/swg/images/smilies/8a80c6485cd926be453217d59a84a888.gif" border=0>" /> occurred in ship Loadouts.exe
I'm running Win xp/sp2

If I chose to run the program "run as" admin in starts but i get this when i tries to make a new ship loadout

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: InvalidArgument=Value of '0' is not valid for 'SelectedIndex'.
Parameter name: SelectedIndex
at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
at ShipLoadouts.MainForm.Reset()
at ShipLoadouts.MainForm.newShipToolStripMenuItem_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll" target=_blank rel=nofollow>file:///C:/WINDOWS/Microsoft.NET/Fr...27/mscorlib.dll
----------------------------------------
Ship Loadouts
Assembly Version: 1.0.2943.42418
Win32 Version:
CodeBase: file:///C:/Program%20Files/Ship%20Loadout%20Utility%20v1.1/Ship%20Loadouts.exe" target=_blank rel=nofollow>file:///C:/Program%20Files/Ship%20L...%20Loadouts.exe
----------------------------------------
msvcm80
Assembly Version: 8.0.50727.762
Win32 Version: 8.00.50727.762
CodeBase: file:///C:/WINDOWS/WinSxS/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700/msvcm80.dll" target=_blank rel=nofollow>file:///C:/WINDOWS/WinSxS/x86_Micro...700/msvcm80.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll" target=_blank rel=nofollow>file:///C:/WINDOWS/assembly/GAC_MSI...ndows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll" target=_blank rel=nofollow>file:///C:/WINDOWS/assembly/GAC_MSI...e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll" target=_blank rel=nofollow>file:///C:/WINDOWS/assembly/GAC_MSI...tem.Drawing.dll
----------------------------------------
CompLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/Ship%20Loadout%20Utility%20v1.1/CompLib.DLL" target=_blank rel=nofollow>file:///C:/Program%20Files/Ship%20L...1.1/CompLib.DLL
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll" target=_blank rel=nofollow>file:///C:/WINDOWS/assembly/GAC_32/...System.Data.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll" target=_blank rel=nofollow>file:///C:/WINDOWS/assembly/GAC_MSI.../System.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


Lee3305  Saturday, February 02, 2008 5:54 PM

Hi, Lee3305,

I think you should debug your application in those systems.

Could you please post some codes which give this exception?

Regards

Yu Guo â€?MSFT  Sunday, February 03, 2008 2:24 AM

You can use google to search for other answers

Custom Search

More Threads

• Windows form loading with form Back ground Image
• Windows Forms : Invoke Members
• Capture MouseClick or MouseDown event in WebBrowser Control
• Halting and Debugging thread?
• Sockets and Windows Forms
• Q: Accessing a control from another thread
• Moving thruogh forms
• Current Window Name
• Including Child Forms
• C# Datagridview removing mutiple rows at the same time