473,840 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

backcolor in ListView Item

In a ListView control (two columns), I added a few
ListView items.

ListView listview=new ListView();
listview.Parent =this;
listview.View=V iew.Details;
listview.Column s.Add
("Col1",200,Hor izontalAlignmen t.Left);
listview.Column s.Add
("Col2",800,Hor izontalAlignmen t.Left);

ListViewItem lvi=newLitViewI tem("1");
lvi.SubItems.Ad d("Item 1");
listview.Items. Add(lvi);

ListViewItem lvi=newLitViewI tem("2");
lvi.SubItems.Ad d("Item 2");
listview.Items. Add(lvi);

When clicking one of the items, the selected one had

backcolor light grey.

But when change focus from the other controls in same form

to the ListView control, the focused ListView item had

backcolor blue.

What I want is set backcolor light grey for ListView items

when they get focus.

How to do it?


Nov 15 '05 #1
0 2235

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: VM | last post by:
How can I fill up a listview with text file contents? My listview has two columns and the first column fills up with a while loop: while (myString != null) { myString = sr.Readline(); listView1.Items.Add (myString); } Is there a way I can fill up the second column this easily? Thw way I'm currently doing it is using the subitems property to add it. Unfortunately,
by: J_Max | last post by:
Hello, This might be a really easy question, but... I am developing a simple Smart Device application that uses a listview. I have a function that adds a item to the listview - code is below. I use the type listviewitem, selitem, on one form to modify the listviewitem, using a timer, every second, and use selitem1 to modify items, after they have ended the time on the timer form, from the form that the listview is located - this way I...
by: Anushya devi | last post by:
Hi All I used listview and tried to update it by using Addrange. When the number of items is less, it works fine.. But I need to update nearly 200,000 items and it hangs. Also i need to add images to listview also(This is to list all the items in my inbox, and want to give the user the feel of outlook). Since it hangs for even 1000 items in the inbox, i tried to shift to virtual listview. But virtual listview
by: MikeY | last post by:
Hopefully someone can help me on this. I am using C#, making Windows forms. I have created a listView with checkbox's. I have enabled the checkboxes under the properties, and all the data, checkbox's and icons are displayed as they are meant to be. My problem is this, I am trying to achieve the same results as I get with CheckListBox(s), where I am able to select (Check-mark) various checkboxs items and able to alter the data. I do...
by: Firewalker | last post by:
I am attempting to change the backColor property on the previously instantiated buttons FROM a listbox_doubleClick event. I thought it would be something like this: If Me.Controls.Item(iSeatNumber).BackColor.Equals(Color.White) Then Me.Controls.Item(iSeatNumber).BackColor.Equals(Color.CornflowerBlue) 'End If
by: Kevin | last post by:
Is there an easy way to modify a CheckedListbox control so that each item can have a different backcolor?
by: Pucca | last post by:
How can I tell a mouse right clicks over a listview item that's in a container panel. I only want to display a popup menu if the user right click the mouse over an item on the Listview. I don't not want to display this menu if a node selected on the listview but user right click over the empty space of the panel that contain the listview. The problem here is when I use the Listview's Click Event, I don't have ways to verify if the...
by: polocar | last post by:
Hello, I'm developing a C# program using Visual Studio 2005 Professional Edition. In the main form I have inserted a ListView control that is populated in a different way depending on the item selected in a ComboBox. I have written a procedure that reads the ComboBox selected item and populates the ListView according to that. The procedure uses a "for" cycle: in every iteration it creates a ListViewItem, set its SubItems and BackColor...
by: Brandon McCombs | last post by:
Hello, I have a form that contains a listview on the left side and a column of buttons on the right side. Only some of the buttons do I want enabled all the time. The other buttons should be enabled only if something is selected in the listview. That part specifically works but not very well. It seems that I can only get the buttons to disable if I click off the text of the items in the listview but still within about 10-20 pixels of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.