回复 5楼wlosg的帖子
wlosg 你好,
可以在点击新单元格时,重置之前点击单元格的边框。我的实现代码如下:
- Dim a As Integer
- Dim b As Integer
- Private Sub Form_Load()
- a = 1
- b = 1
-
- End Sub
- Private Sub fpSpread1_Click(ByVal Col As Long, ByVal Row As Long)
- fpSpread1.Row = a
- fpSpread1.Col = b
-
- fpSpread1.SetCellBorder b, a, b, a, CellBorderIndexRight, vbRed, CellBorderStyleDefault
- fpSpread1.SetCellBorder b, a, b, a, CellBorderIndexLeft, vbRed, CellBorderStyleDefault
- fpSpread1.SetCellBorder b, a, b, a, CellBorderIndexTop, vbRed, CellBorderStyleDefault
- fpSpread1.SetCellBorder b, a, b, a, CellBorderIndexBottom, vbRed, CellBorderStyleDefault
-
- fpSpread1.Row = Row
- fpSpread1.Col = Col
-
- fpSpread1.SetCellBorder Col, Row, Col, Row, CellBorderIndexRight, vbGreen, CellBorderStyleSolid
- fpSpread1.SetCellBorder Col, Row, Col, Row, CellBorderIndexLeft, vbRed, CellBorderStyleSolid
- fpSpread1.SetCellBorder Col, Row, Col, Row, CellBorderIndexTop, vbRed, CellBorderStyleSolid
- fpSpread1.SetCellBorder Col, Row, Col, Row, CellBorderIndexBottom, vbRed, CellBorderStyleSolid
-
- a = fpSpread1.Row
- b = fpSpread1.Col
-
- End Sub
复制代码 |