我的程序是VB.net的,麻烦您给看下,问题出在哪里。谢谢Imports C1.Win.C1FlexGrid
Public Class Form1
Private Info As HitTestInfo
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
C1FlexGrid1.Rows.Count = 7
C1FlexGrid1.Cols.Count = 6
C1FlexGrid1.Rows.MinSize = 30
C1FlexGrid1.Cols(3).Width = 250
C1FlexGrid1.Cols(3).Editor = C1MultiSelect1
C1MultiSelect1.Separator = "/"
C1FlexGrid1(1, 3) = ""
C1FlexGrid1(2, 3) = "张三/李四/"
C1FlexGrid1(3, 3) = "李小二/张三/"
C1FlexGrid1(4, 3) = "许忠义/张三/李四/"
C1FlexGrid1.Cols(5).Width = 250
C1FlexGrid1.Cols(5).Editor = C1CheckList1
C1FlexGrid1(1, 5) = "李小二/张三/李四/"
C1FlexGrid1(2, 5) = "张三/李四/"
C1FlexGrid1(3, 5) = "李小二/张三/"
C1FlexGrid1(4, 5) = "许忠义/张三/李四/"
C1FlexGrid1.ContextMenuStrip = ContextMenuStrip1
End Sub
Private Sub C1FlexGrid1_MouseClick(sender As Object, e As MouseEventArgs) Handles C1FlexGrid1.MouseClick
' If (e.Button = Windows.Forms.MouseButtons.Left) Then
Info = C1FlexGrid1.HitTest(e.X, e.Y)
' MsgBox("Info.e.X=" & Info.X & Chr(13) & "Info.e.Y=" & Info.Y & Chr(13) & "Info.Row=" & Info.Row & Chr(13) & "Info.Col=" & Info.Column)
' End If
End Sub
Private Sub C1FlexGrid1_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles C1FlexGrid1.MouseDoubleClick
If C1FlexGrid1.Col = 3 Then
If IsNothing(C1FlexGrid1(C1FlexGrid1.Row, 3)) Then
C1MultiSelect1.Text = ""
Else
C1MultiSelect1.Text = C1FlexGrid1(C1FlexGrid1.Row, 3)
End If
Dim cText As String = C1MultiSelect1.Text
For Each item In C1MultiSelect1.Items
If cText.Contains(item.Value.ToString) Then
item.Selected = True
End If
Next
End If
If C1FlexGrid1.Col = 5 Then
C1CheckList1.Height = 100
Dim cText As String = C1FlexGrid1(C1FlexGrid1.Row, 5)
For Each item In C1CheckList1.Items
If cText.Contains(item.Value.ToString) Then
item.Selected = True
End If
Next
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click '充填下拉复选框内容
Dim kk As String() = "李小二|张三|李四|许忠义|尚飞".Split("|")
Dim i%
For i = 0 To kk.Count - 1
C1MultiSelect1.Items.Add(kk(i))
C1CheckList1.Items.Add(kk(i))
Next
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click '清除下拉复选内容
If C1MultiSelect1.Items.Count > 0 Then C1MultiSelect1.Items.Clear()
End Sub
Private Sub 人员安排ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 人员安排ToolStripMenuItem.Click
C1FlexGrid1.StartEditing(C1FlexGrid1.Row, 3)
End Sub
End Class
|