[.Net] Datagrid BackgroundImage

Datagrid BackgroundImage [.Net] - C#/.NET managed - Programmation

Marsh Posté le 17-05-2005 à 14:54:55    

Bonjour,  
 
Environnement: VS .NET 2003 Fr  
Framework :1.1
OS: Windows XP Pro  
 
Je voudrais afficher une image en arriere plan de mon Datagrid. Voici mon code (en Vb.Net):  
 

Code :
  1. Dim MonImage As Image
  2. MonImage = Image.FromFile("C:\\img.jpg" )
  3. DataGrid1.BackgroundColor = System.Drawing.Color.Transparent
  4. DataGrid1.BackgroundImage = MonImage

 
 
J'ai lu au cours de mes recherches pour y arriver qu'il fallait passer la couleur du background à : transparent.  
 
Mais j'ai aussi lu sur le site de microsft dont voici l'URL : http://msdn2.microsoft.com/library [...] s.80).aspx
 
Remarks :  
The System.Windows.Forms.DataGrid control cannot display background images, so this property has no effect.  
 
Je comprends mieux pourquoi mon bout de code ne marche pas. Mais quelqu'un connaitrait un moyen pour y arriver quand même ?  
 
Personnellement j'ai essayé de mettre un Panel, contenant l'image de fond, derrière le DataGrid et de mettre sa propriété backgroundcolor à transparent, sans aucun résultat.  
 
Quelqu'un aurait - il la solution ?  
 
Merci

Reply

Marsh Posté le 17-05-2005 à 14:54:55   

Reply

Marsh Posté le 19-05-2005 à 14:40:54    

En mettant ton DataGrid ds un tableau et en définissant le fond du tableau avec une image çà devrait marcher, nan ?

Reply

Marsh Posté le 19-05-2005 à 17:04:37    

En passant par le concepteur ça marche... Je te le confirme

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed