addhanderl与handels区别

遇到一个问题。addhandler 与 handels的区别是什么

举例:如下语句运行成功

 Private Sub 供货商IDSearchLookUpEdit_TextChanged(sender As Object, e As EventArgs) Handles 供货商IDSearchLookUpEdit.TextChanged
        MsgBox(sender.name, MsgBoxStyle.OkCancel, "测试")
End Sub

如下语句不成功

Private Sub 主界面_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    AddHandler 供货商IDSearchLookUpEdit.TextChanged, AddressOf 供货商IDSearchLookUpEdit_TextChanged
end sub

Private Sub 供货商IDSearchLookUpEdit_TextChanged(sender As Object, e As EventArgs)
        'Handles 供货商IDSearchLookUpEdit.TextChanged
        MsgBox(sender.name, MsgBoxStyle.OkCancel, "测试")
End Sub

 

如何修改 cell 值

Private Sub GridView1_CellValueChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs) Handles GridView1.CellValueChanged
        If e.Column.FieldName = "FieldName" Then
            GridView1.SetRowCellValue(e.RowHandle, "columnName", "value")
        End If
End Sub

注:千万必要写成以下形式,否则会引发System.StackOverflowException 异常

Private Sub GridView1_CellValueChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs) Handles GridView1.CellValueChanged
        If GridView1.FocusedColumn.FieldName = "FieldName" Then
            GridView1.SetRowCellValue(e.RowHandle, "columnName", "value")
        End If
End Sub

相关链接:https://www.devexpress.com/Support/Center/Question/Details/T352822

如何让TreeListLookup在弹出时,自动对焦到搜索框

QQ截图20160516152712

如图所示,在弹出时,自动对焦到红框区域。

 Private Sub 商品查找品牌RepositoryItemTreeListLookUpEdit_Popup(sender As Object, e As EventArgs) Handles 商品查找品牌RepositoryItemTreeListLookUpEdit.Popup
        Dim editor As TreeListLookUpEdit = CType(sender, TreeListLookUpEdit)
        editor.Properties.TreeList.ShowFindPanel()
End Sub
 Private Sub 商品查找商品RepositoryItemSearchLookUpEdit_Popup(sender As Object, e As EventArgs) Handles 商品查找商品RepositoryItemSearchLookUpEdit.Popup
        Dim editor As SearchLookUpEdit = CType(sender, SearchLookUpEdit)
        editor.Properties.View.ShowFindPanel()
End Sub

 

使用微软语言包实现汉字(还其他非汉字字符)转拼音

微软官方语言包下载地址:http://www.microsoft.com/downloads/zh-cn/details.aspx?FamilyID=44cac7f0-633b-477d-aed2-99aee642fc10&DisplayLang=zh-cn

备份下载地址:链接: http://pan.baidu.com/s/1dF4oTfr 密码: dx4h

使用方法:完成之后在项目中引用安装目录中的ChnCharInfo.dll即可

实现汉字转拼音demo(原创)

Imports Microsoft.International.Converters.PinYinConverter
Module Demo
Public Enum 拼音格式
        首字母 = 0
        全拼 = 1
    End Enum

    Public Function 获取拼音码(ByVal inputText As String, Optional 拼音格式 As 拼音格式 = 拼音格式.首字母) As String
        if inputText is Nothing or inputText="" then 
            return Nothing
        end if
        Dim PY As String = ""
        For Each Cha In inputText.Trim()
            Try
                Dim chinesechar As ChineseChar = New ChineseChar(Cha)
                Select Case 拼音格式
                    Case 拼音格式.首字母
                        PY += chinesechar.Pinyins(0).Substring(0, 1).ToLower
                    Case 拼音格式.全拼
                        PY += chinesechar.Pinyins(0).ToLower
                End Select
            Catch ex As System.NotSupportedException
                PY += Cha         ‘遇到非中文字符,直接原样返回
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        Next
        Return PY
End Function
End Module

多音字不知如何处理,比如:蹲(dūn、cún )的结果为cún

ACCESS 对非空进行排序

来源:http://bbs.csdn.net/topics/390095462

举例:表如下

ID 名称 排序
1 测试1
2 测试2
3 测试3 2
4 测试4
5 测试5 1
6 测试6 3
7 测试7 5
8 测试8

现需要按【排序】字段排序,且NULL在后

SELECT *
FROM 表
ORDER BY (IIf(IsNull(排序),1000,排序))

参考IIF用法:http://baike.baidu.com/link?url=5U8efxCJxo62stmF4PbFhusGY7WeqmOQ2FkRhpvpEuJiWY57Kw4u2X4D5BE_O8YAFjgR5oP4KGICrcUKiJxWh_

未能正确加载“RoslynPackage”包

在安装完DexExpress后,启动VS2015每次创建新项目都弹出“未能正确加载“RoslynPackage”包”的对话框,解决方法如下:

1、删除以下文件夹%appdata%\Local\Microsoft\VisualStudio\14.0\ComponentModelCache (以防万一,请做好备份)

2、删除以下文件夹%appdata%\Local\Microsoft\VisualStudio\14.0\Extensions (以防万一,请做好备份)。P.S.无法删除的话就删除文件夹内的文件。

3、重新打开VS2015,程序自动扫描已安装的扩展并重新生成新的文件夹