Dim dCell As New FarPoint.Web.Spread.GeneralCellType
Dim numFormat As New System.Globalization.NumberFormatInfo
numFormat.NumberDecimalDigits = 0
dCell.NumberFormat = numFormat
dCell.FormatString = "n"
Dim numFormat As New System.Globalization.NumberFormatInfo
numFormat.NumberDecimalDigits = 0
dCell.NumberFormat = numFormat
dCell.FormatString = "n"
参考以下方法
t=System.Threading.Thread.CurrentThread;
oldCulture=t.CurrentCulture;
System.Globalization.CultureInfo newci = (System.Globalization.CultureInfo)oldCulture.Clone();
newci.DateTimeFormat.DayNames=new string[]{"日","一","二","三","四","五","六"};
newci.DateTimeFormat.FirstDayOfWeek=DayOfWeek.Sunday;
t.CurrentCulture=newci;
oldCulture=t.CurrentCulture;
System.Globalization.CultureInfo newci = (System.Globalization.CultureInfo)oldCulture.Clone();
newci.DateTimeFormat.DayNames=new string[]{"日","一","二","三","四","五","六"};
newci.DateTimeFormat.FirstDayOfWeek=DayOfWeek.Sunday;
t.CurrentCulture=newci;
作成以下解决方案
Private t As System.Threading.Thread
Private oldCulture As System.Globalization.CultureInfo
Private Sub FPspread1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles ssList.PreRender
t = System.Threading.Thread.CurrentThread
oldCulture = t.CurrentCulture
Dim newci As System.Globalization.CultureInfo = DirectCast(oldCulture.Clone(), System.Globalization.CultureInfo)
newci.NumberFormat.CurrencySymbol = ""
newci.NumberFormat.NumberDecimalDigits = 0
t.CurrentCulture = newci
End Sub
Private oldCulture As System.Globalization.CultureInfo
Private Sub FPspread1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles ssList.PreRender
t = System.Threading.Thread.CurrentThread
oldCulture = t.CurrentCulture
Dim newci As System.Globalization.CultureInfo = DirectCast(oldCulture.Clone(), System.Globalization.CultureInfo)
newci.NumberFormat.CurrencySymbol = ""
newci.NumberFormat.NumberDecimalDigits = 0
t.CurrentCulture = newci
End Sub
知识点:
System.Globalization 命名空间包含定义区域性相关信息的类,这些信息包括语言、国家/地区、使用的日历、日期、货币和数字的格式模式以及字符串的排序顺序。