Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. problem with c# (help required)

problem with c# (help required)

Scheduled Pinned Locked Moved C#
helpcsharpgraphics
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    Hi, I was making a very simple windows application in C#. the application runs fine when i create a new windows application but when i add a button on the form a problem occurs. Although the application compiles correctly, but when i run the application it gives an exception saying, "An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll Additional information: Overflow or underflow in the arithmetic operation." I am really confused here because i am placing the button on the form using the form designer. i have not even touched the code itself. i also tried to add the button to the form by coding myself but the same problem exists. please help me i will be really thankful. bye.

    T C 2 Replies Last reply
    0
    • A Anonymous

      Hi, I was making a very simple windows application in C#. the application runs fine when i create a new windows application but when i add a button on the form a problem occurs. Although the application compiles correctly, but when i run the application it gives an exception saying, "An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll Additional information: Overflow or underflow in the arithmetic operation." I am really confused here because i am placing the button on the form using the form designer. i have not even touched the code itself. i also tried to add the button to the form by coding myself but the same problem exists. please help me i will be really thankful. bye.

      T Offline
      T Offline
      tdciDoug
      wrote on last edited by
      #2

      Try changing your code to the following and seeing if it helps any: [DllImport("msvcr70.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int _controlfp(int n, int mask); [STAThread] static void Main() { _controlfp(_CW_DEFAULT, 0xfffff); Application.Run(new Form1()); }

      1 Reply Last reply
      0
      • A Anonymous

        Hi, I was making a very simple windows application in C#. the application runs fine when i create a new windows application but when i add a button on the form a problem occurs. Although the application compiles correctly, but when i run the application it gives an exception saying, "An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll Additional information: Overflow or underflow in the arithmetic operation." I am really confused here because i am placing the button on the form using the form designer. i have not even touched the code itself. i also tried to add the button to the form by coding myself but the same problem exists. please help me i will be really thankful. bye.

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Something is really weird. What does the code that gets added look like ? Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups