apExcel.ActiveCell.MergeArea.RowHeight = _
apExcel.ActiveSheet.StandardHeight * _
(Int(frmProd.TextWidth(cInDef) / apExcel.ActiveCell.MergeArea.Width * nScaleFactor) + 1)
有没有textwidth。NET属性,我怎样才能把它转换感谢......|托尼・拉杜:约翰・西蒙斯/取缔程序员:是这样(容易地发现谷歌):
Dim g As Graphics = Me.CreateGraphics()
Dim textSize As Size = g.MeasureString(cInDef, Me.Font).ToSize()
apExcel.ActiveCell.MergeArea.RowHeight = _
apExcel.ActiveSheet.StandardHeight * _
(Int(textSize.Width / apExcel.ActiveCell.MergeArea.Width * nScaleFactor) + 1)
g.Dispose()