彻底移除 Windows 10 的 OneDrive

来源:http://bbs.pcbeta.com/viewthread-1740194-1-3.html

1、移除资源管理器导航栏的 OneDrive

将下列内容存为RemoveOneDrive.reg文件,并双击导入注册表

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}]
"System.IsPinnedToNameSpaceTree"=dword:00000000

2、完美卸载

按WIN+R,输入【cmd】,点“确定”,运行以下三个命令:

taskkill /f /im OneDrive.exe
%SystemRoot%\System32\OneDriveSetup.exe /uninstall   
%SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall

如何彻底删除或卸载OneDrive
清理OneDrive残留数据。运行删除残余数据命令:

rd "%UserProfile%\OneDrive" /Q /S
rd "%LocalAppData%\Microsoft\OneDrive" /Q /S
rd "%ProgramData%\Microsoft OneDrive" /Q /S
rd "C:\OneDriveTemp" /Q /S

再运行注册表项删除命令:

REG Delete "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f
REG Delete "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f

 

GridView.RowCount 与 GridView.DataRowCount 的区别

RowCount

GridView.RowCount Property | WinForms Controls | DevExpress Help

This property overrides the BaseView.RowCount property to increment its value in the following cases:

NoteDetail pattern Views do not contain data and they are never displayed within XtraGrid. So, the RowCount member must not be invoked for these Views. The RowCount member can only be used with real Views that are displayed within the Grid Control. The real Views with which an end-user interacts at runtime can be accessed using the following methods.

DataRowCount

BaseView.DataRowCount Property | WinForms Controls | DevExpress Help

Note that data rows can be hidden within collapsed groups when data grouping is applied. The DataRowCount property returns the total number of data rows regardless of whether they are within collapsed groups or not. Also, the property’s return value is not always the same as the number of records within the associated data source. When data filtering is applied, the DataRowCount property returns the number of rows that match the filter condition.

NoteDetail pattern Views do not contain data and they are never displayed within XtraGrid. So, the DataRowCount member must not be invoked for these Views. The DataRowCount member can only be used with real Views that are displayed within the Grid Control. The real Views with which an end-user interacts at runtime can be accessed using the following methods.

试比较:

Private Sub GridView1_MouseDown(sender As Object, e As MouseEventArgs) Handles GridView1.MouseDown
        Dim view As GridView = TryCast(sender, GridView)
        Dim hitInfo As GridHitInfo = view.CalcHitInfo(e.Location)
        Select Case hitInfo.HitTest
            Case GridHitTest.Column
                SelectColumn(view, hitInfo)
            Case Else                ' 
                view.OptionsSelection.MultiSelect = False
                view.OptionsSelection.MultiSelectMode = GridMultiSelectMode.RowSelect
        End Select
 End Sub

 Private Sub SelectColumn(ByRef View As GridView, ByRef hitinfo As GridHitInfo)
        '全选列(不排列)
        View.OptionsSelection.MultiSelect = True
        View.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect
        View.OptionsCustomization.AllowSort = False
        View.ClearSelection()

        View.SelectCells(New GridCell(0, hitinfo.Column), New GridCell(View.DataRowCount - 1, hitinfo.Column))
        View.OptionsCustomization.AllowSort = True
End Sub

 

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_