aber dann müsste das auf meinem Entwicklungsrechner doch auch sein?
Hier mal der Code.
Das Paint:
Private Sub NotizDataGridView_CellPainting(ByVal sender As Object, ByVal e As _
System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles _
NotizDataGridView.CellPainting
If loading Then Return
If e.RowIndex = -1 Then
If e.ColumnIndex = 2 Then
Dim dgv = CType(sender, DataGridView)
Using s As New IO.FileStream(IO.Path.Combine( _
Application.StartupPath, "Filter.ico"), IO.FileMode.Open)
Dim img = AutoSizeImage(Image.FromStream(s), 20, 20)
GridDrawCustomHeaderColumns(CType(sender, DataGridView), e, _
img, DGVHeaderImageAlignments.SingleRight)
End Using
ElseIf e.ColumnIndex = 3 Then
GridDrawCustomHeaderColumns(CType(sender, DataGridView), e, _
Nothing, DGVHeaderImageAlignments.Default)
Else
End If
End If
If e.ColumnIndex < 1 OrElse e.RowIndex < 0 Then Return
If loading OrElse DataSet.Beenden Then Return
Try
If NotizDataGridView.Columns(e.ColumnIndex).DataPropertyName = _
DataSet.Notiz.KurztextColumn.ColumnName Then
If NotizBindingSource.At(Of NotizRow)( _
e.RowIndex).GetAufgabeRows.Count > 0 Then
Dim img As Image = Nothing
Dim nr = NotizBindingSource.At(Of ProjektDts.NotizRow)( _
e.RowIndex)
If Not nr Is Nothing AndAlso nr.GetAufgabeRows.Count > 0 Then
For Each ar In nr.GetAufgabeRows
If Not ar.IsErinnerungNull AndAlso ar.Erinnerung _
> Date.MinValue Then
img = ImageList1.Images(70) : Exit For ' 70 =
' Wecker
NotizDataGridView.Rows(e.RowIndex).Cells( _
e.ColumnIndex).ToolTipText = "Erinnerung am " _
& ar.Erinnerung.ToString
ElseIf Not ar.IsLangtextNull AndAlso _
ar.Langtext.Length > 0 Then
img = ImageList1.Images(71) ' 71 =
' Schraubenschlüssel
End If
Next
End If
If img Is Nothing Then Return
Dim bc As System.Drawing.Color = e.CellStyle.BackColor '
' NotizDataGridView.Rows(e.RowIndex).Cells(
' e.ColumnIndex).Style.BackColor
If bc = Color.Transparent Then bc = Color.WhiteSmoke
Using sb As New SolidBrush(bc)
e.Graphics.FillRectangle(sb, e.CellBounds)
End Using
Dim mask = DataGridViewPaintParts.All Xor _
DataGridViewPaintParts.ContentBackground ' zeichne alles
' ausser Hintergrund, den machen wir.
e.Paint(e.CellBounds, mask)
img = AutoSizeImage(img, e.CellBounds.Height - 20, _
e.CellBounds.Height - 20)
If img Is Nothing Then Return
e.Graphics.DrawImage(img, New Rectangle(e.CellBounds.Right _
- (img.Width + 3), e.CellBounds.Top + 2, img.Width, _
img.Height))
e.Handled = True
End If
End If
Catch ex As Exception
InfoBox(ex.Message)
End Try
End Sub Danke für die Hilfe
Gruß Christian |