回复 8楼lifesky2006的帖子
这是我目前调查的进度,先共享给您:
- Private Sub Command1_Click()
- fpSpread1.MaxCols = 3
- fpSpread1.UnitType = UnitTypeTwips
- Dim width As Long, height As Long
-
- Dim i As Long
-
- fpSpread1.GetClientArea width, height
- If fpSpread1.BorderStyle = BorderStyleFixedSingle Then
- width = width - (2 * Screen.TwipsPerPixelX) ' Borders
- End If
- For i = 0 To fpSpread1.RowHeaderCols - 1
- width = width - fpSpread1.ColWidth(i)
- width = width - (1 * Screen.TwipsPerPixelX) ' Gridlines
- Next i
- For i = 1 To fpSpread1.MaxCols
- width = width - (1 * Screen.TwipsPerPixelX) ' Gridlines
- Next i
- width = width - (17 * Screen.TwipsPerPixelX)
-
- For i = 1 To fpSpread1.MaxCols
- fpSpread1.ColWidth(i) = width / fpSpread1.MaxCols
- Next i
-
- End Sub
复制代码 |