2010-07-01から1ヶ月間の記事一覧
//小数部取得 private Decimal GetDec(decimal decValue) { return decValue - decimal.Truncate(decValue) ; } //少数部桁数取得 private int GetNumberPlace(decimal decValue) { string strTmp; strTmp = decValue.ToString(); strTmp= strTmp.Substring …
VBだとLikeで簡単。C#にはLIKEがないので、以下のように行う。 if (Regex.IsMatch(textBox1.Text, "^[0-9]$", RegexOptions.Singleline ) == false) { MessageBox .Show ("数字のみ入力してください。"); }参考: Regex クラス (System.Text.RegularExpressi…