C# listview to add combobox to cell implementation code
Updated: June 18, 2014 14:50:07 Submission: mdxy-dxy
I transferred from elsewhere and made some minor changes myself. It's not bad. You can first drag a ListView1 and a ComboBox1. Friends who need it can refer to it.
Implementation code:
using System; using ; using ; using ; using ; using ; using ; using ; using ; namespace WindowsFormsApplication1 { public partial class Form1 : Form { ListViewItem lvi; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { = false; ("First Column"); ("Second Column"); ("Third Column"); this.("Bryant"); this.("Yao Ming"); this.("Durant"); this.("Duncan"); ListViewItem item; item = new ListViewItem(()); ("Yao Ming"); ("Bryant"); (item); item = new ListViewItem(()); ("Duncan"); ("Durant"); (item); } private void listView1_MouseUp(object sender, MouseEventArgs e) { lvi = this.(, ); if (lvi != null) { //Get the Bounds of the selected row Rectangle Rect = ; int LX = [0].Width; int RX = [0].Width + [1].Width; // if ( > RX || < LX) //{ this. = false; = + [0].Width + 2; = this. + 2+; = [1].Width + 2; this. = Rect; this. = [1].Text; this. = true; this.(); this.(); //} // int intColIndex = ((, )); } } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { [1].Text = ; // = false; } private void comboBox1_MouseLeave(object sender, EventArgs e) { [1].Text = ; // = false; } } }
Related Articles
C# combined with Javascript test to obtain weather information
This article will introduce how to use C# and combine JavaScript to obtain weather information. The data obtained comes from the homepage data of 360 browser. Friends who are interested in obtaining weather information sample codes will take a look.2024-08-08C# md5 algorithm implementation code
Compared with C#, the md5 algorithm is relatively simple because the md5 algorithm is already included. So we only need to create MD5 object to implement the md5 algorithm. Today, through this article, we will introduce the implementation of C# md5 algorithm. Interested friends, let’s take a look.2022-11-11Analysis of Covariance and Inverter Examples of New Features of C#4.0
This article mainly introduces the covariance and inversion of the new features of C# 4.0. It is a relatively practical new feature. Friends who need it can refer to it.2014-09-09Summary of the usage of AutoResetEvent control thread in C#
This article mainly comes from an interview question. Since the concept of AutoResetEvent was vague before, the interview question was very concise: two threads alternately print odd and even numbers of 0~100, you can try it first. I mainly try to complete this task in one method. Friends who need it can refer to it.2022-07-07Practical methods and codes for opening speakers in C#
In this article, we share with you the relevant knowledge points about how to turn on the speakers of C#, readers who need it to learn it.2019-08-08Detailed explanation of C# single-threaded and multi-threaded port scanner
This article mainly introduces C# single-threaded and multi-threaded port scanner in detail. The sample code in the article is introduced in detail and has certain reference value. Interested friends can refer to it.2022-07-07Summary of the use of HighCharts chart control in WebForm (full)
This article mainly introduces the summary of the use of HighCharts chart control in WebForm (full). Friends who need it can refer to it.2015-08-08Detailed explanation of the steps for developing cad preview tiles in C#
In this article, the editor has shared with you the steps and related knowledge points about C# development cad preview tiles. Friends who need it will learn it.2019-02-02C# Batch the image using OpenCv image and change the image size and rename it
This article mainly introduces C# using OpenCv image batch processing, changing the image size and renaming. The article introduces the sample code in detail, which has certain reference learning value for everyone's learning or work. Friends who need it, please learn with the editor below.2020-02-02Summary of several ways to verify global control in login (session)
When login verification or other needs to use session global variables, in summary, there are mainly three more convenient implementation methods. (I personally prefer to use the first implementation method)2014-01-01