Visual Basic.NET - FocusRect en DataGridView -codigo en otro lenguaje

 
Vista:

FocusRect en DataGridView -codigo en otro lenguaje

Publicado por Preguntador VB.NET (22 intervenciones) el 22/02/2007 11:36:06
Hola, hace unos dias pregunte como se podia quitar el rectangulo punteado que indica que una celda tiene el foco en un Datagridview, y he encontrado este codigo, pero esta en otro lenguaje y no se como pasarlo a VB, por que no se que significa el caracter ~ en este codigo. Os pongo el codigo que he visto:


The DataGridView does not have any built in way to suppress the focus rectangle around the cell. The best you can do is either

A-- Handle the CellPainting event and call:

e.Paint(e.ClipBounds, (DataGridViewPaintParts.All & ~DataGridViewPaintParts.Focus));
e.Handled = true;


or
B -- Handle the RowPrePaint and "and" out the PaintParts.Focus:

e.PaintParts = (DataGridViewPaintParts.All & ~DataGridViewPaintParts.Focus);
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Solucionado

Publicado por Preguntador VB.NET (22 intervenciones) el 22/02/2007 11:49:38
Ya esta solucionado, por un despiste mio no me salia bien, aunque intuia el codigo en VB. Os lo pongo:

Private Sub DataGridView1_CellPainting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles DataGridView1.CellPainting
e.Paint(e.CellBounds, DataGridViewPaintParts.All And Not DataGridViewPaintParts.Focus)
e.Handled = True
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar