我希望下拉框的宽度和第一列宽度调整同步,可在SpdCol_ColumnWidthChanged事件中,取得的第一个单元格的宽度是上次调整第1列宽度,而不是当次调整第1列的宽度。
Private Sub SpdCol_ColumnWidthChanged(sender As Object, e As FarPoint.Win.Spread.ColumnWidthChangedEventArgs) Handles SpdCol.ColumnWidthChanged
Dim Rct As System.Drawing.Rectangle
If e.View.ActiveSheetIndex = 2 Then
Rct = SpdCol.GetCellRectangle(0, 0, 0, 0)
CmbYDE.Left = SpdCol.Left + Rct.Left
CmbYDE.Width = Rct.Width
CmbYDE.Top = SpdCol.Top + Rct.Top - CmbYDE.Height
End If
End Sub
|
|