Author Topic: How to store data from form  (Read 2262 times)

0 Members and 1 Guest are viewing this topic.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
How to store data from form
« on: November 07, 2011, 11:00:00 AM »
I am trying to pull the values from comboBoxes, textBoxes etc. out of a form and convert to int or double etc.  The challenge is the feet and inches that is coming from the string values.  In the old days, (using VBA) I would do a HUGE select case statement going through each string, and figure out what the choice was.  In C# is there an easier way to avoid this?  I was thinking of maybe using an Enum and comparing the # of the comboBox to the same # in the Enum.  Is there a better way?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Jeff H

  • Needs a day job
  • Posts: 6150
Re: How to store data from form
« Reply #1 on: November 07, 2011, 11:17:42 AM »
Autodesk.AutoCAD.Runtime.Converter.StringToDistance()?
 &
Autodesk.AutoCAD.Runtime.Converter.DistanceToString()?
http://www.theswamp.org/index.php?topic=39271.msg444992#msg444992

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: How to store data from form
« Reply #2 on: November 07, 2011, 11:37:03 AM »
Very Nice!!!  Thanks again Jeff
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)