如题!在线等!
解决马上给分!
解决马上给分!
解决方案 »
- 寻求伙伴一起开发“等级考试上机系统”
- VBA控制excel在关闭时候弹出对话框??
- 问一个很简单的问题,路过的请帮我回答,,非常感谢!vb中的savefiledlalog 和openFiledialog控件在哪儿,我怎么找不到?请大家告诉我谢
- 关于VB多窗口的问题,急
- 访问一个文件夹下所有的文件夹中所有文件的信息
- 如何将 Microsoft Excel 10.0 Object Library 打入包中?>
- 如何用VBS实现网页跳转(求代码)
- 请问在vb中如何穷举出窗口中所有控件?谢谢
- 在使用msflexgrid控件中出现的问题
- 如何从richtextbox里面读出每一行的数据????
- 求问 对象不支持该属性或方法
- 郁闷!郁闷!郁闷!都是些老问题!
with hflexgrid
if trim(.textmatrix(.row,0))="" then
.textmatrix(.row,0)="√"
else
.textmatrix(.row,0)=""
end if
end with
End Subprivate sub command1_click()
dim i as long
with hflexgrid
for i=1 to .rows-1
if trim(.textmatrix(i,0))="√" then
'为“选中”时的处理
end if
next i
end with
end sub
Private m_sinCountCellHeight As Single '所有行的高度
Private m_intSelect As Integer '0 代表没有选中记录,大于0代表有选中记录数
Private m_strSelect As String '当为"0,"时代表没有选中记录,否则代表有选中记录Private Sub Command1_Click()
Dim ss As String
Dim i As Integer, j As Integer
With Grd1 For i = 1 To .Rows - 1
For j = 1 To .Cols - 1
.Row = i
.Col = j
If .CellBackColor = vbBlue Then ss = ss & ",(" & i & ":" & j & ")"
Next j
Next
If Len(ss) > 0 Then
ss = Mid(ss, 2)
MsgBox "你选择的记录为 " & ss, 64
Else
MsgBox "你没有选择记录!", 64
End If
End With
End SubPrivate Sub Form_Load()
Dim i, j As Integer
m_intSelect = 0
m_strSelect = "0"
With Grd1
.Rows = 10
.Cols = 3
For i = 1 To .Rows - 1
For j = 1 To .Cols - 1
.TextMatrix(i, j) = i
Next
Next
.Row = 0
For i = 0 To .Cols - 1
.Col = i
m_sinCountCellWidth = m_sinCountCellWidth + .CellWidth
Next
.Col = 0
For i = 0 To .Rows - 1
.Row = i
m_sinCountCellHeight = m_sinCountCellHeight + .CellWidth
Next
End With
End SubPrivate Sub Grd1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim i, j, k As Integer
Dim StaRow, EndRow As Integer
Dim XMax, YMax As Single
Dim RowArray As Variant
With Grd1
k = .Row
If .RowSel > .Row Then
StaRow = .Row
EndRow = .RowSel
Else
StaRow = .RowSel
EndRow = .Row
End If XMax = .Left + m_sinCountCellWidth
YMax = .Top + m_sinCountCellHeight If x > XMax Or Shift <> 2 Then
If m_strSelect <> "0" Then
RowArray = Split(m_strSelect, ",")
For i = 1 To UBound(RowArray)
'If i = 0 Then Exit For
.Row = RowArray(i)
For j = 1 To .Cols - 1
.Col = j
.CellBackColor = vbWhite
Next
Next
End If
m_strSelect = "0"
Exit Sub
End If
If Shift = 2 Then
If .CellBackColor = vbBlue Then
m_strSelect = Replace(m_strSelect, "," & .Row, "")
Else
m_strSelect = m_strSelect & "," & .Row
End If
If .CellBackColor = vbBlue Then
.CellBackColor = vbWhite
Else
.CellBackColor = vbBlue End If
Exit Sub
End If
End With
End Sub