TheSwamp

Code Red => .NET => Topic started by: David Hall on November 07, 2011, 11:00:00 AM

Title: How to store data from form
Post by: David Hall 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?
Title: Re: How to store data from form
Post by: Jeff H 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 (http://www.theswamp.org/index.php?topic=39271.msg444992#msg444992)
Title: Re: How to store data from form
Post by: David Hall on November 07, 2011, 11:37:03 AM
Very Nice!!!  Thanks again Jeff