最近谈论较多的就是Datagrid,特别新手最是郁闷为何没有更好的控件,来满足自已的需求。
其实通过重写可以达到很多不同的功能体验,在这里我们仅仅讨论关于datagridcolumnstyle重写的问题
==========================================
Power by: landlordh
Datatime: 2005-08-04
转载请注明出处,谢谢
==========================================
1。重写TextBox:
Public Class XP_TextBox
Inherits System.Windows.Forms.TextBox
#Region " Windows "
Public Sub New()
MyBase.New()
InitializeComponent()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
''Windows
Private components As System.ComponentModel.IContainer
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
''
''TextBox
''
Me.EnableContextMenu = True
Me.EnablePaste = True
Me.Name = "TextBox"
End Sub
#End Region
#Region " Variables "
Private m_EnPaste As Boolean = True
Private m_EnContextMenu As Boolean = True
#End Region
#Region " Property "
Property EnablePaste() As Boolean
Get
Return m_EnPaste
End Get
Set(ByVal Value As Boolean)
m_EnPaste = Value
Me.Invalidate()
End Set
End Property
Property EnableContextMenu() As Boolean
Get
Return m_EnContextMenu
End Get
Set(ByVal Value As Boolean)
m_EnContextMenu = Value
Me.Invalidate()
&
