Showing posts with label 【Visual Studio Visual Csharp】Item Color. Show all posts
Showing posts with label 【Visual Studio Visual Csharp】Item Color. Show all posts

Sunday, 23 May 2021

【Visual Studio Visual Csharp】Item Color

 using System;

using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace ItemColorC { public partial class Form1 : Form { public Form1() { InitializeComponent(); listBox1.DrawMode = DrawMode.OwnerDrawFixed; listBox1.DrawItem += listBox1_DrawItem; } private void listBox1_DrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground(); Graphics g = e.Graphics; Color color = Color.blue; for (int i = 0; i < listBox1.Items.Count; i++) { g.DrawString("ListBoxItem", e.Font, new SolidBrush(color), new PointF(e.Bounds.X, e.Bounds.Y)); } e.DrawFocusRectangle(); } } }

BREAKING: North Carolina automotive group acquires 7 Upstate dealerships

Breaking news from GSA Business Report Click here to view this message in a browser window. ...