Visual Studio 2017

Microsoft Visual Studio Enterprise 2017 企业版
KEY:NJVYC-BMHX2-G77MM-4XJMR-6Q8QF
Microsoft Visual Studio Professional 2017 专业版
KEY:KBJFW-NXHK6-W4WJM-CRMQB-G3CDH

彻底移除 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

 

XPO 最佳实践(XPO Best Practices)

来源:https://www.devexpress.com/Support/Center/Question/Details/A2944

1. Always define a constructor with a Session parameter in your persistent objects.
This will help you prepare for point 4 (see below) and will also allow you to avoid the exception explained in the 
A751 article.

[C#]

public class OrderDetail : XPObject {
   public OrderDetail(Session session) : base(session) { 
   }
   // ...
}

[VB.NET]

Public Class OrderDetail
   Inherits XPObject
   Public Sub New(ByVal session As Session)
       MyBase.New(session)
   End Sub
   ' ...
End Class

继续阅读XPO 最佳实践(XPO Best Practices)

如何给程序添加自定义皮肤

来源:https://documentation.devexpress.com/#SkinEditor/CustomDocument2546
1、在VS里,通过Devexpress>Winform Controls v…>Run Skin Editor启动皮肤编辑器

2、新建皮肤项目

3、选择基础皮肤,记住新皮肤名称(skin name)

4、选择要修改的控件,双击黄框部分进行图像编辑。
注:请在Tools>Options…菜单下,指定图像编辑器程序

5、图像编辑完成后,单击【Load Image】等进行图像替换

6、保存工程后,通过菜单File>Create Assembly生成dll。默认在文档\My DXSkins文件夹下

7、随后弹出如下窗口。将这些内容对应地复制到解决方案的 Program.cs/Program.vb 文件的方法里。

8、打开【解决方案资源管理器】,添加引用
注:添加完成后,需要保存解决方案,重启VS。

9、打开【Program.vb】文件,添加如下内容。

注:参考步骤7内容

Imports System
Imports System.Configuration
Imports System.Windows.Forms
Imports DevExpress.Persistent.Base
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Security
Imports DevExpress.ExpressApp.Win
Imports DevExpress.Persistent.BaseImpl
Imports 乐智ERP.Win
Imports DevExpress.Skins
Imports System.ComponentModel
Imports DevExpress.LookAndFeel

Public Class Program

    <STAThread()>
    Public Shared Sub Main(ByVal arguments() As String)


        '开始
        Dim asm As System.Reflection.Assembly = GetType(DevExpress.UserSkins.ilezhiskin).Assembly
        DevExpress.Skins.SkinManager.Default.RegisterAssembly(asm)
        SkinManager.EnableFormSkins()
        '结束


#If EASYTEST Then
              DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register()
#End If

        Application.EnableVisualStyles()
        Application.SetCompatibleTextRenderingDefault(False)
        EditModelPermission.AlwaysGranted = System.Diagnostics.Debugger.IsAttached
        If Tracing.GetFileLocationFromSettings() = DevExpress.Persistent.Base.FileLocation.CurrentUserApplicationDataFolder Then
            Tracing.LocalUserAppDataPath = Application.LocalUserAppDataPath
        End If
        Tracing.Initialize()
        Dim _application As 乐智ERPWindowsFormsApplication = New 乐智ERPWindowsFormsApplication()
        ' Refer to the https://documentation.devexpress.com/eXpressAppFramework/CustomDocument112680.aspx help article for more details on how to provide a custom splash form.
        '_application.SplashScreen = New DevExpress.ExpressApp.Win.Utils.DXSplashScreen("YourSplashImage.png")
        SecurityAdapterHelper.Enable()
        If (Not ConfigurationManager.ConnectionStrings.Item("ConnectionString") Is Nothing) Then
            _application.ConnectionString = ConfigurationManager.ConnectionStrings.Item("ConnectionString").ConnectionString
        End If
#If EASYTEST Then
        If (Not ConfigurationManager.ConnectionStrings.Item("EasyTestConnectionString") Is Nothing) Then
            _application.ConnectionString = ConfigurationManager.ConnectionStrings.Item("EasyTestConnectionString").ConnectionString
        End If
#End If
        If System.Diagnostics.Debugger.IsAttached Then
            _application.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways
        End If
        Try
            '开始
            UserLookAndFeel.Default.SkinName = "ilezhi"
            ‘结束
            _application.Setup()
            _application.Start()
        Catch e As Exception
            _application.HandleException(e)
        End Try
    End Sub
End Class

’开始
Public Class SkinRegistration
    Inherits Component

    Public Sub New()
        DevExpress.Skins.SkinManager.Default.RegisterAssembly(GetType(DevExpress.UserSkins.ilezhiskin).Assembly)
    End Sub
End Class
‘结束

 

======================= 有用的皮肤数据=======================

Common > TextBorder,文本边框

 

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