Background
Break News
How to add local font to Tailwind Css and NextJS? - Tutorial Design Pattern? - Blockchain Technology, How to create own Bitcoin virtual currency - Zustand mordern management state - Design Pattern - Flyweight Pattern? - Docker Full training Topic

[Tips] How to Customize ListView with Image on C# use GlacialList control

Monday, 23 November 2015
|
Read: Completed in minutes

[Tips] How to Customize ListView with Image on C# use GlacialList control

GlacialList is a custom control for C# that extends the functionality of the ListView control. It allows you to display images, text, and other controls in a grid-like layout, with various features such as sorting, grouping, editing, and custom drawing.

To use GlacialList in your project, you need to add a reference to the GlacialComponents.Controls.dll assembly, and then drag and drop the GlacialList control from the toolbox to your form. You can customize the appearance and behavior of the control using its properties, methods, and events. You can also use the designer to add columns and items to the control.

To display images in GlacialList, you need to create an ImageList object and assign it to the ImageList property of the control. You can then add images to the ImageList using its Images collection or methods. You can also specify the size and alignment of the images using the ImageSize and ImageAlignment properties of the control.

To associate an image with an item in GlacialList, you need to set the ImageIndex or ImageKey property of the GLItem object that represents the item. You can also use the SubItems collection or methods of the GLItem object to add subitems with images to the item.

Almost default control in C# will limit the feature, example don't have image display on listview on button, etc ... So the topic today will introduce you a guideline how to Working with ListView, ListBox Control with GlacialList control component, in C#, Example: I'll show you use one dll help you Customize ListView, ListBox with any Button, Checkbox, image, progress bar on any columns

How to Customize ListView with Image on C# use GlacialList control


You can download my custom dll ListView from below link


Download resource:

Download source code:





Download dll:






- Default ListView on ToolBox (Design mode) is only create checkbox and image on the first columns.
- Customize ListView (GlacialList) can give you customize easily with button, checkbox, image, progress bar, …You can easy to use it by follow my video – Live Demo

Live demo:


Part 1: Introduce Customize ListView

Help you working with GlacialList easily and introduce how to use it, please lool video



Part 2 - Introduce how to use Event in GlacialList Control

Introduce how to use Event GlacialList control click

Part 3 - Introduce how to customize GlacialList 

Normal ListView and ListBox haven't support that:D, introduce how to customize color and interface of GlacialList control


Main Source Code



/* ****************************************************************************************************
 * Developer: Zidane (huuvi168@gmail.com)
 * Last Modified: 2015-11-11
 * Feature: Custom ListView, ListBox (GlacialList Control)
 * ****************************************************************************************************/
using GlacialComponents.Controls;
using System;
using System.Collections;
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 GlacialListLibDemo
{
    public partial class frmDemo : Form
    {
        public frmDemo()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // this can also be added through the design time support 
            mylist.Columns.Add("No", 80); 
            mylist.Columns.Add("Name", 150);
            mylist.Columns.Add("Title", 200);
            mylist.Columns.Add("Checked", 100);
            mylist.Columns.Add("Note", 200);


            // checkbox on the first columns
            mylist.Columns[0].ActivatedEmbeddedType = 
                  GlacialComponents.Controls.GLActivatedEmbeddedTypes.TextBox;
            mylist.Columns[0].CheckBoxes = true;
            mylist.Columns[0].State = ColumnStates.csNone;



            GLItem item;
            item = this.mylist.Items.Add("1");
            item.SubItems[1].Text = "Zidane";
            item.SubItems[2].Text = "Senior Manager";
            item.SubItems[2].BackColor = Color.Bisque;
            item.SubItems[3].Text = "Yes / No";
            item.SubItems[3].ImageIndex = 0;
            
            ProgressBar pb = new ProgressBar();            
            item.SubItems[4].Control = pb;
            pb.Style = ProgressBarStyle.Marquee;
            
            item = this.mylist.Items.Add("2");
            item.SubItems[1].Text = "LearnTechTips";
            item.SubItems[2].Text = "CEO Learn Tech Tips";            
            item.SubItems[3].Text = "Yes / No";
            item.SubItems[3].ImageIndex = 0;

            Button btn = new Button();
            item.SubItems[4].Control = btn;
            btn.Text = "Click me!";
            btn.Click += btn_Click;

            item = this.mylist.Items.Add("3");
            item.SubItems[1].Text = "Cross";
            item.SubItems[2].Text = "Staff";
            item.SubItems[3].Text = "Yes / No";
            item.SubItems[3].ImageIndex = 1;
            Button btn2 = new Button();
            item.SubItems[4].Control = btn2;
            btn2.Text = "Click me!";

            item = this.mylist.Items.Add("4");
            item.SubItems[1].Text = "Fayt";
            item.SubItems[2].Text = "Supervisor";
            item.SubItems[3].Text = "Yes / No";
            item.SubItems[3].ImageIndex = 0;

            Button btn3 = new Button();
            item.SubItems[4].Control = btn3;
            btn3.Text = "Click me!";

            item = this.mylist.Items.Add("5");
            item.SubItems[1].Text = "Fayt";
            item.SubItems[2].Text = "Supervisor";
            item.SubItems[3].Text = "Yes / No";
            item.SubItems[3].ImageIndex = 0;
            item.SubItems[4].ImageIndex = 1;
            item.SubItems[4].Text = "Very Good";
            
        }

        void btn_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Hello Learn Tech Tips!");
        }

        private void mylist_Click(object sender, EventArgs e)
        {            
            for (int i = 0; i < mylist.Items.Count; i++)
                if (mylist.Items[i].SubItems[0].Checked == true)
                    MessageBox.Show(mylist.Items[i].SubItems[0].Text.ToString());
        }
    }
}

For you reference full projects from below link, you can download it, it free!



Thank you for reading this post. I hope you found it helpful and easy to follow. If you have any feedback or questions about ListView with Image C# - GlacialList , please share them in the comments below. I would love to hear from you and discuss this topic further
✋✋✋✋  Webzone Tech Tips, all things Tech Tips for web development  - I am Zidane, See you next time soon ✋✋✋✋

🙇🏼🙇🏼 Your Feedback Is Valuable and Helpful to Us - Webzone, all things Tech Tips web development Zidane
Popular Webzone Tech Tips topic maybe you will be like it - by Webzone Tech Tips - Zidane
As a student, I found Blogspot very useful when I joined in 2014. I have been a developer for years . To give back and share what I learned, I started Webzone, a blog with tech tips. You can also search for tech tips zidane on Google and find my helpful posts. Love you all,

I am glad you visited my blog. I hope you find it useful for learning tech tips and webzone tricks. If you have any technical issues, feel free to browse my posts and see if they can help you solve them. You can also leave a comment or contact me if you need more assistance. Here is my blog address: https://learn-tech-tips.blogspot.com.

My blog where I share my passion for web development, webzone design, and tech tips. You will find tutorials on how to build websites from scratch, using hot trends frameworks like nestjs, nextjs, cakephp, devops, docker, and more. You will also learn how to fix common bugs on development, like a mini stackoverflow. Plus, you will discover how to easily learn programming languages such as PHP (CAKEPHP, LARAVEL), C#, C++, Web(HTML, CSS, javascript), and other useful things like Office (Excel, Photoshop). I hope you enjoy my blog and find it helpful for your projects. :)

Thanks and Best Regards!
Follow me on Tiktok @learntechtips and send me a direct message. I will be happy to chat with you.
Webzone - Zidane (huuvi168@gmail.com)
I'm developer, I like code, I like to learn new technology and want to be friend with people for learn each other
I'm a developer who loves coding, learning new technologies, and making friends with people who share the same passion. I have been a full stack developer since 2015, with more than years of experience in web development.
Copyright @2022(November) Version 1.0.0 - By Webzone, all things Tech Tips for Web Development Zidane
https://learn-tech-tips.blogspot.com