Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BackgroundImage in ListView
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01297600
Message ID:
01297795
Vues:
23
>Is there a way to specify where the BackgroundImage image should display in the listview?
>I want it either centered or in the lower right-hand corner, but it seems that M$ wants it is the upper left-hand corner. It seems the only thing I can do with the BackgroundImage is to set the BackgroundImageTiled property.
>
>Thanks,
>Einar

Here is how I ended up solving my problem. It is not elegant but it works.

Call this code when listview is resized
Bitmap bitmap = new Bitmap(this.listView.Width, this.listView.Height);
Bitmap logo = new Bitmap(somefilepath);

Graphics graphics = Graphics.FromImage(bitmap);
graphics.FillRegion(Brushes.White, new Region(new Rectangle(0, 0, bitmap.Width, bitmap.Height)));
graphics.DrawImage(logo, new Point(bitmap.Width - logo.Width - 25, bitmap.Height - logo.Height - 50));
graphics.Dispose();

this.listView.BackgroundImage = bitmap;
Only one problem remaining. When I scroll down in my listview the logo does not move.
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform