m***@yahoo.com
2007-07-05 22:10:06 UTC
I west a lot of time to put below code work. but we west time for poor
Microsof Framework!
see also: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=21016&SiteID=1
Any MPV to resolve this problem in decade?
I suggest Microsoft to Publish a Book that contain all code that not
work. this save our time.
============================
Public Class Form1
Class MyFormat
Implements IFormatProvider
Implements ICustomFormatter
Public Function GetFormat(ByVal formatType As System.Type) As
Object Implements System.IFormatProvider.GetFormat
Return Me
End Function
Public Function Format(ByVal format_str As String, ByVal arg
As Object, ByVal formatProvider As System.IFormatProvider) As String
Implements System.ICustomFormatter.Format
Return New String("blabal")
End Function
End Class
WithEvents DataGridView1 As New System.Windows.Forms.DataGridView
WithEvents Column1 As New
System.Windows.Forms.DataGridViewTextBoxColumn
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'=====this follow lines working
Dim s = String.Format(New MyFormat, "{0}", 11212)
MsgBox(s)
'=========But this not work ??
Me.Column1.DefaultCellStyle.FormatProvider = New MyFormat
Me.Column1.DefaultCellStyle.Format = "{0}"
DataGridView1.Columns.Add(Me.Column1)
DataGridView1.Size = New System.Drawing.Size(389, 176)
Me.Controls.Add(DataGridView1)
End Sub
End Class
Microsof Framework!
see also: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=21016&SiteID=1
Any MPV to resolve this problem in decade?
I suggest Microsoft to Publish a Book that contain all code that not
work. this save our time.
============================
Public Class Form1
Class MyFormat
Implements IFormatProvider
Implements ICustomFormatter
Public Function GetFormat(ByVal formatType As System.Type) As
Object Implements System.IFormatProvider.GetFormat
Return Me
End Function
Public Function Format(ByVal format_str As String, ByVal arg
As Object, ByVal formatProvider As System.IFormatProvider) As String
Implements System.ICustomFormatter.Format
Return New String("blabal")
End Function
End Class
WithEvents DataGridView1 As New System.Windows.Forms.DataGridView
WithEvents Column1 As New
System.Windows.Forms.DataGridViewTextBoxColumn
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'=====this follow lines working
Dim s = String.Format(New MyFormat, "{0}", 11212)
MsgBox(s)
'=========But this not work ??
Me.Column1.DefaultCellStyle.FormatProvider = New MyFormat
Me.Column1.DefaultCellStyle.Format = "{0}"
DataGridView1.Columns.Add(Me.Column1)
DataGridView1.Size = New System.Drawing.Size(389, 176)
Me.Controls.Add(DataGridView1)
End Sub
End Class