Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / September 2005

Tip: Looking for answers? Try searching our database.

problems with changing fonts

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nathan Guill - 19 Sep 2005 21:02 GMT
Everytime I change a font (from the properties window) I get an error.  I
can remove the line of code VB generates and I get no errors, but I would
like to be able to change fonts.  Any ideas what is causing this?  I have
tried adding Imports System.Drawing.Font without any affect.
Chris Dunaway - 21 Sep 2005 14:36 GMT
Well, it would be helpful to know what the error is and the code you
used to change the font.
Nathan Guill - 21 Sep 2005 20:53 GMT
I have been using the properties of a control in the design window to change
the fonts.  I do not directly change the code.  Here is an example of the
code VB generates:

Me.txtFirst.Font = New System.Drawing.Font("Arial", 8.25!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point,
CType(0, Byte))

The exception I get is as follow:

An unhandled exception has occurred in your application. If you click
Continue, the application will ignore this error and attempt to continue. If
you click Quit, the application will be shut down immediately.

Overflow or underflow in arithmetic operation.

************** Exception Text **************

System.ArithmeticException: Overflow or underflow in the arithmetic
operation.

  at System.Drawing.Font.Initialize(FontFamily family, Single emSize,
FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean
gdiVerticalFont)

  at System.Drawing.Font.Initialize(String familyName, Single emSize,
FontStyle style, GraphicsUnit unit)

  at System.Drawing.Font..ctor(String familyName, Single emSize)

  at
Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.DisplayToolTip(String
text)

  at
Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.DisplayToolTip(ToolBa
se tool)

  at Infragistics.Win.UltraWinToolbars.ToolBase.DisplayToolTip()

  at
Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.set_ImmediateToolTipD
isplayMode(Boolean value)

  at Infragistics.Win.UltraWinToolbars.ButtonToolUIElement.OnMouseHover()

  at Infragistics.Win.ControlUIElementBase.NotifyMouseHover(UIElement
element)

  at Infragistics.Win.ControlUIElementBase.OnHoverTimer_Tick(Object sender,
EventArgs e)

  at System.Windows.Forms.Timer.OnTick(EventArgs e)

  at System.Windows.Forms.Timer.DebuggableCallback(IntPtr hWnd, Int32 msg,
IntPtr idEvent, IntPtr dwTime)

> Well, it would be helpful to know what the error is and the code you
> used to change the font.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.