this.gridView1.Click += new System.EventHandler(this.gridView1_Click);
this.gridView1.CustomDrawColumnHeader +=
new DevExpress.XtraGrid.Views.Grid.ColumnHeaderCustomDrawEventHandler
(this.gridView1_CustomDrawColumnHeader);
this.gridView1.DataSourceChanged +=
new EventHandler(gridView1_DataSourceChanged);
请问这几句代码转换成VB.NET语句后是什么?C#中的+=是什么意思呢
addhandler me.gridView1.Click, address of gridView1_Click
addhandler me.gridView1.CustomDrawColumnHeader , address of gridView1_CustomDrawColumnHeader
...
你不知道,可以安装一个SharpDevloper或是Google C# vb.net convert,
网上有直接帮你转换的工具。
Private Sub frmOut_Load
output.ValueUnchecked = 0
output.ValueChecked = 1
end sub
Private Sub gvInstore_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvInstore.Click
If gvInstore.FocusedRowHandle >= 0 Then
Dim val As String = gvInstore.GetRowCellValue(gvInstore.FocusedRowHandle, gvInstore.Columns("出库")).ToString()
If val = "1" Then
val = "0"
Else
val = "1"
End If
gvInstore.SetRowCellValue(gvInstore.FocusedRowHandle, gvInstore.Columns("出库"), val)
Dim repositorycheck As RepositoryItemCheckEdit = gvInstore.Columns(12).ColumnEdit
If Not repositorycheck Is Nothing Then
With repositorycheck
AddHandler .QueryCheckStateByValue, AddressOf checkEdit_QueryCheckStateByValue
End With
End If
End If
End Sub
Private Sub checkEdit_QueryCheckStateByValue(ByVal sender As Object, ByVal e As DevExpress.XtraEditors.Controls.QueryCheckStateByValueEventArgs)
Dim val As String = ""
If Not e.Value Is Nothing Then
val = e.Value.ToString()
Else
val = "false"
End If
Select Case val
Case "true"
e.CheckState = CheckState.Checked
Case "false"
e.CheckState = CheckState.Unchecked
Case "yes"
e.CheckState = CheckState.Checked
Case "no"
e.CheckState = CheckState.Unchecked
Case "0"
e.CheckState = CheckState.Checked
Case "1"
e.CheckState = CheckState.Unchecked
End Select
End Sub
我这样写的代码,想实现多选,不知道哪里写错了,大神能不能帮忙给看看啊?我可以追加给园豆的
@贾晓俊AA: 太复杂了。
1、不要去模仿WEB界面。
2、WINFORM里面这个GridControl本身有多选功能,在OptionsSelection里面设置MultiSelection=True即可。按Ctrl或Shift加鼠标点击可多选。
@爱编程的大叔: 我用的是dev的gridcontrol
@贾晓俊AA: 我用的也是。
@爱编程的大叔: 那DEV的GC如何实现多选呢?
@贾晓俊AA: GridControl里面有个GridView,GridView有个属性组叫OptionsSelection,里面有个MultiSelect
@爱编程的大叔:
还是不能多选啊,选别的,原来的对勾就自动没有了
@贾晓俊AA: Devexpress公司在设计Winform表格控件的时候,就没有打算用Checkbox来表示选择。而是用的变色,选择的行颜色会变化的。
@爱编程的大叔: 那如果我想实现想选择哪一行就勾选哪一行,该怎么实现呢?请大神给指点个方向吧?
@爱编程的大叔: 还是没操作成功。。。唉
.NET Reflector
什么意思呢?