PDA

View Full Version : سوال: گذاشتم عكس رو دكمه ديتاگريد



s.k711
یک شنبه 25 اردیبهشت 1390, 16:16 عصر
سلام دوستان ، خسته نباشيد.
به نظر شما كدام قسمت اين كد را تغيير بدم تا رو دكمه هاي ديتاگريدم عكسي كه ميخوام نمايش بده.
البته اومدم تو برنامم يك سري تغييرات تو اين كد دادم ولي نميدونم چرا هر آدرسي كه براي آيكون انتخاب ميكنم پيغام error ميده كه ايكني وجود نداره :متفکر:





Private Sub dataGridView1_CellPainting(ByVal sender As Object, ByVal e As DataGridViewCellPaintingEventArgs) Handles DataGridView1.CellPainting
If e.ColumnIndex = 0 AndAlso e.RowIndex >= 0 Then

e.Paint(e.CellBounds, DataGridViewPaintParts.All)
Dim btnDgv As DataGridViewButtonCell = TryCast(DataGridView1(0, e.RowIndex), DataGridViewButtonCell)
Dim x As Boolean

If btnDgv.Tag Is Nothing Then

x = False

Else

x = CBool(btnDgv.Tag)
End If

If x Then

Dim ico As New Icon("Lock.Ico")
e.Graphics.DrawIcon(ico, e.CellBounds.Left, e.CellBounds.Top)
End If

e.Handled = True

End If

End Sub

s.k711
دوشنبه 26 اردیبهشت 1390, 05:53 صبح
كسي نيست، دارم كم كم از اين سايت نااميد و دلسرد ميشم.
پستهاي من بي جواب است...:افسرده: