http://converter.telerik.com/
源码来自SharpDevelop(对应软件自带解决方案转码工具)
http://www.icsharpcode.net/OpenSource/SD/Download/Default.aspx#SharpDevelop5x
http://converter.telerik.com/
源码来自SharpDevelop(对应软件自带解决方案转码工具)
http://www.icsharpcode.net/OpenSource/SD/Download/Default.aspx#SharpDevelop5x
出处:http://www.fmddlmyy.cn/text6.html
这是一篇程序员写给程序员的趣味读物。所谓趣味是指可以比较轻松地了解一些原来不清楚的概念,增进知识,类似于打RPG游戏的升级。整理这篇文章的动机是两个问题:
我很早前就发现Unicode、Unicode big endian和UTF-8编码的txt文件的开头会多出几个字节,分别是FF、FE(Unicode),FE、FF(Unicode big endian),EF、BB、BF(UTF-8)。但这些标记是基于什么标准呢?
查了查相关资料,总算将这些问题弄清楚了,顺带也了解了一些Unicode的细节。写成一篇文章,送给有过类似疑问的朋友。本文在写作时尽量做到通俗易懂,但要求读者知道什么是字节,什么是十六进制。
1、打开注册表
2、定位到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
3、在右侧删除PendingFileRenameOperations项
来源:http://jingyan.baidu.com/article/a24b33cd52a0b919fe002bae.html
遇到一个问题。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
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
如图所示,在弹出时,自动对焦到红框区域。
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://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
来源: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_
在安装完DexExpress后,启动VS2015每次创建新项目都弹出“未能正确加载“RoslynPackage”包”的对话框,解决方法如下:
1、删除以下文件夹%appdata%\Local\Microsoft\VisualStudio\14.0\ComponentModelCache (以防万一,请做好备份)
2、删除以下文件夹%appdata%\Local\Microsoft\VisualStudio\14.0\Extensions (以防万一,请做好备份)。P.S.无法删除的话就删除文件夹内的文件。
3、重新打开VS2015,程序自动扫描已安装的扩展并重新生成新的文件夹
'来源:http://www.vbforums.com/showthread.php?622242-TabControl-with-Close-button-on-TabPages-(with-Design-Time-support) Option Strict On Imports System.ComponentModel <ToolboxBitmap(GetType(System.Windows.Forms.TabControl))> Public Class TabControlEx Inherits System.Windows.Forms.TabControl Private Declare Auto Function SetParent Lib "user32" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr Protected CloseButtonCollection As New Dictionary(Of Button, TabPage) Private _ShowCloseButtonOnCurrentTab As Boolean = True Private _ShowCloseButtonOnTabs As Boolean = False <Browsable(True), DefaultValue(True), Category("Behavior"), Description("Indicates whether a close button should be shown on each TabPage")> Public Property ShowCloseButtonOnCurrentTab() As Boolean Get Return _ShowCloseButtonOnCurrentTab End Get Set(ByVal value As Boolean) _ShowCloseButtonOnCurrentTab = value For Each btn In CloseButtonCollection.Keys btn.Visible = _ShowCloseButtonOnCurrentTab Next RePositionCloseButtons() End Set End Property <Browsable(True), DefaultValue(True), Category("Behavior"), Description("Indicates whether a close button should be shown on each TabPage")> Public Property ShowCloseButtonOnTabs() As Boolean Get Return _ShowCloseButtonOnTabs End Get Set(ByVal value As Boolean) _ShowCloseButtonOnTabs = value RePositionCloseButtons() End Set End Property Protected Overrides Sub OnCreateControl() MyBase.OnCreateControl() For Each item In CloseButtonCollection item.Value.Text = item.Value.Text.Trim & Space(4) Next RePositionCloseButtons() End Sub Protected Overrides Sub OnControlAdded(ByVal e As System.Windows.Forms.ControlEventArgs) MyBase.OnControlAdded(e) Dim tp As TabPage = DirectCast(e.Control, TabPage) Dim rect As Rectangle = Me.GetTabRect(Me.TabPages.IndexOf(tp)) Dim btn As Button = AddCloseButton(tp) btn.Size = New Size(rect.Height - 1, rect.Height - 1) btn.Location = New Point(rect.X + rect.Width - rect.Height - 1, rect.Y + 1) SetParent(btn.Handle, Me.Handle) AddHandler btn.Click, AddressOf OnCloseButtonClick CloseButtonCollection.Add(btn, tp) End Sub Protected Overrides Sub OnControlRemoved(ByVal e As System.Windows.Forms.ControlEventArgs) Dim btn As Button = CloseButtonOfTabPage(DirectCast(e.Control, TabPage)) RemoveHandler btn.Click, AddressOf OnCloseButtonClick CloseButtonCollection.Remove(btn) SetParent(btn.Handle, Nothing) btn.Dispose() MyBase.OnControlRemoved(e) End Sub Protected Overrides Sub OnLayout(ByVal levent As System.Windows.Forms.LayoutEventArgs) MyBase.OnLayout(levent) RePositionCloseButtons() End Sub Public Event CloseButtonClick As CancelEventHandler Protected Overridable Sub OnCloseButtonClick(ByVal sender As Object, ByVal e As EventArgs) If Not DesignMode Then Dim btn As Button = DirectCast(sender, Button) Dim tp As TabPage = CloseButtonCollection(btn) Dim ee As New CancelEventArgs RaiseEvent CloseButtonClick(sender, ee) If Not ee.Cancel Then If MsgBox("是否关闭 " + tp.Text.Trim + "标签?") = MsgBoxResult.Ok Then Me.TabPages.Remove(tp) RePositionCloseButtons() End If End If End If End Sub Protected Overridable Function AddCloseButton(ByVal tp As TabPage) As Button Dim closeButton As New Button With closeButton '' TODO: Give a good visual appearance to the Close button, maybe by assigning images etc. '' Here I have not used images to keep things simple. .Text = "X" .FlatStyle = FlatStyle.Flat .BackColor = Color.FromKnownColor(KnownColor.ButtonFace) .ForeColor = Color.White .Font = New Font("Microsoft Sans Serif", 6, FontStyle.Bold) End With Return closeButton End Function Public Sub RePositionCloseButtons() For Each item In CloseButtonCollection RePositionCloseButtons(item.Value) Next End Sub Public Sub RePositionCloseButtons(ByVal tp As TabPage) Dim btn As Button = CloseButtonOfTabPage(tp) If btn IsNot Nothing Then Dim tpIndex As Integer = Me.TabPages.IndexOf(tp) If tpIndex >= 0 Then Dim rect As Rectangle = Me.GetTabRect(tpIndex) If Me.SelectedTab Is tp Then btn.BackColor = Color.Red btn.Size = New Size(rect.Height - 1, rect.Height - 1) btn.Location = New Point(rect.X + rect.Width - rect.Height, rect.Y + 1) btn.Visible = ShowCloseButtonOnCurrentTab Else btn.BackColor = Color.FromKnownColor(KnownColor.ButtonFace) btn.Size = New Size(rect.Height - 3, rect.Height - 3) btn.Location = New Point(rect.X + rect.Width - rect.Height - 1, rect.Y + 1) btn.Visible = Me.ShowCloseButtonOnTabs End If btn.BringToFront() End If End If End Sub Protected Function CloseButtonOfTabPage(ByVal tp As TabPage) As Button Return (From item In CloseButtonCollection Where item.Value Is tp Select item.Key).FirstOrDefault End Function End Class