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. WPF
  4. Make a textbox act like Excell Cell

Make a textbox act like Excell Cell

Scheduled Pinned Locked Moved WPF
csharpasp-netcomhelp
7 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.
  • V Offline
    V Offline
    Vimalsoft Pty Ltd
    wrote on last edited by
    #1

    Hi All i am converting an Excell spreadsheet into an application. So i am doing automatic calculations like Excell do , for some of the cells(textbox) should allow a user to enter the minus sign "-" , and this automatically minus value entered. So my issue here is if th the users enters that character it breaks my app's calculations. Does anyone have any idea how to bypass this ? Thanks

    Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com

    P P 2 Replies Last reply
    0
    • V Vimalsoft Pty Ltd

      Hi All i am converting an Excell spreadsheet into an application. So i am doing automatic calculations like Excell do , for some of the cells(textbox) should allow a user to enter the minus sign "-" , and this automatically minus value entered. So my issue here is if th the users enters that character it breaks my app's calculations. Does anyone have any idea how to bypass this ? Thanks

      Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Vuyiswa Maseko wrote:

      So my issue here is if th the users enters that character it breaks my app's calculations. Does anyone have any idea how to bypass this ?

      Without knowing how your application works, no. I don't know what code you've actually written, so how can I tell you what's wrong with it. I will say one thing though - if you can cope with positive numbers, you should be able to cope with negative ones. After all, taking away is merely adding a negative number.

      *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

      "Mind bleach! Send me mind bleach!" - Nagy Vilmos

      CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

      V 1 Reply Last reply
      0
      • P Pete OHanlon

        Vuyiswa Maseko wrote:

        So my issue here is if th the users enters that character it breaks my app's calculations. Does anyone have any idea how to bypass this ?

        Without knowing how your application works, no. I don't know what code you've actually written, so how can I tell you what's wrong with it. I will say one thing though - if you can cope with positive numbers, you should be able to cope with negative ones. After all, taking away is merely adding a negative number.

        *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

        "Mind bleach! Send me mind bleach!" - Nagy Vilmos

        CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

        V Offline
        V Offline
        Vimalsoft Pty Ltd
        wrote on last edited by
        #3

        hi Pete Thanks for your reply. i am just looking at ideas without any coding examples. What i need is a logic to bypass this. lets take a Cell in an Excel spreadsheet,you normally can enter numeric values and by default anything that has no sign "-" is a "+" so now when it comes to negative in Excel it will subtract the value in the cell from somewhere. So in .e.g asp.net or silverlight , if you want to mimic that Excel behavior how can do that , because immediately when that value is entered it changes the data in the textbox not to fall under "int" or "decima" because there is a special character. You know what ? i just Figured out. i will keep the value as is and when it is being calculated against another Field , i will sum what needs to be summed and subtract on any field that has that sign Sometimes when you explain the problem to someone you might find the solutiion Thanks

        Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com

        P 1 Reply Last reply
        0
        • V Vimalsoft Pty Ltd

          hi Pete Thanks for your reply. i am just looking at ideas without any coding examples. What i need is a logic to bypass this. lets take a Cell in an Excel spreadsheet,you normally can enter numeric values and by default anything that has no sign "-" is a "+" so now when it comes to negative in Excel it will subtract the value in the cell from somewhere. So in .e.g asp.net or silverlight , if you want to mimic that Excel behavior how can do that , because immediately when that value is entered it changes the data in the textbox not to fall under "int" or "decima" because there is a special character. You know what ? i just Figured out. i will keep the value as is and when it is being calculated against another Field , i will sum what needs to be summed and subtract on any field that has that sign Sometimes when you explain the problem to someone you might find the solutiion Thanks

          Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Vuyiswa Maseko wrote:

          Sometimes when you explain the problem to someone you might find the solutiion

          Often the way my friend, and a 5 for such enlightenment.

          *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

          "Mind bleach! Send me mind bleach!" - Nagy Vilmos

          CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

          V 1 Reply Last reply
          0
          • P Pete OHanlon

            Vuyiswa Maseko wrote:

            Sometimes when you explain the problem to someone you might find the solutiion

            Often the way my friend, and a 5 for such enlightenment.

            *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

            "Mind bleach! Send me mind bleach!" - Nagy Vilmos

            CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

            V Offline
            V Offline
            Vimalsoft Pty Ltd
            wrote on last edited by
            #5

            :)

            Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com

            1 Reply Last reply
            0
            • V Vimalsoft Pty Ltd

              Hi All i am converting an Excell spreadsheet into an application. So i am doing automatic calculations like Excell do , for some of the cells(textbox) should allow a user to enter the minus sign "-" , and this automatically minus value entered. So my issue here is if th the users enters that character it breaks my app's calculations. Does anyone have any idea how to bypass this ? Thanks

              Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com

              P Offline
              P Offline
              PaulLinton
              wrote on last edited by
              #6

              Are you aware of this article A Calculation Engine for .NET[^]

              V 1 Reply Last reply
              0
              • P PaulLinton

                Are you aware of this article A Calculation Engine for .NET[^]

                V Offline
                V Offline
                Vimalsoft Pty Ltd
                wrote on last edited by
                #7

                Thanks nice

                Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com

                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