473,473 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

displaying list (in a pretty way)

Hi there,
I'd like to display list of items in my form. Each item has 3 properties
i.e.
description , picture (1 of 3 kinds), and url. I want to display it in nice
way, e.g.
every second row should have different background, additionaly I'd like the
background to change (3rd color) when mouse is hovering over the row.
Moreover I'd like to support drag 'n' drop on each item. User cannot change
anything on the list.

I have already created a form which does all these things but it isn't
very efficient. I just created a panel, and for each row of data I created a
few controls, each time setting proper size and location , and proper event
handlers (for hovering, and drag'n'drop).

I'm sure there is a way to do it better, for instance using listview or
datagrid. Data to be displayed are placed in DataTable but I'd rather use
listview (datagrid seems to be harder to display data the way I want).

If you have any suggestions/ideas , please.

Regards,
Piotrek Stachowicz
Nov 16 '05 #1
1 1363
There is an easier way. You need to override the drawing of the item, and change the colour of the backgroudn, depending upon what state the control is in. There are definitely samples on the net to show you how to change the fonts and background colours of a listbox. I did something very similar, so if you really can't find anything I'll copy my code up here for you...

Cheers,

Martin.

"Piotrek Stachowicz" wrote:
Hi there,
I'd like to display list of items in my form. Each item has 3 properties
i.e.
description , picture (1 of 3 kinds), and url. I want to display it in nice
way, e.g.
every second row should have different background, additionaly I'd like the
background to change (3rd color) when mouse is hovering over the row.
Moreover I'd like to support drag 'n' drop on each item. User cannot change
anything on the list.

I have already created a form which does all these things but it isn't
very efficient. I just created a panel, and for each row of data I created a
few controls, each time setting proper size and location , and proper event
handlers (for hovering, and drag'n'drop).

I'm sure there is a way to do it better, for instance using listview or
datagrid. Data to be displayed are placed in DataTable but I'd rather use
listview (datagrid seems to be harder to display data the way I want).

If you have any suggestions/ideas , please.

Regards,
Piotrek Stachowicz

Nov 16 '05 #2

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

Similar topics

2
by: Andreas Kuntzagk | last post by:
Hi, There are three ways to (shallow)copy a list l I'm aware of: >>> l2=list(l) >>> l2=l >>> l2.copy.copy(l) Are there any differences? Are there more (reasonable) ways? I think the first...
35
by: Moosebumps | last post by:
Does anyone here find the list comprehension syntax awkward? I like it because it is an expression rather than a series of statements, but it is a little harder to maintain it seems. e.g. you...
3
by: hartbypass | last post by:
Hello all, I have a small piece of code that goes and gets the files in a directory and displays them as hyperlinks on a webpage so people can access those files. I am running into an issue...
0
by: Michael | last post by:
Hi Everyone, I had posted a message about the dropdownlist not displaying newly added items. Just alittle background. I'm working with a masterpage and a usercontrol(Search control) (VS2005) that...
26
by: unexpected | last post by:
If have a list from 1 to 100, what's the easiest, most elegant way to print them out, so that there are only n elements per line. So if n=5, the printed list would look like: 1 2 3 4 5 6 7 8...
3
G Jones
by: G Jones | last post by:
Let me start by saying I am a graphic designer who understand things very well, but by no means am I a programmer or developer. So here is my question.... I have put together a simple form that...
7
by: =?Utf-8?B?Sm9lbCBNZXJr?= | last post by:
I have created a custom class with both value type members and reference type members. I then have another custom class which inherits from a generic list of my first class. This custom listneeds...
1
by: N4t4lie | last post by:
Hi there, I was wondering if anyone could help me? I have a program which has a form that should display 10 items which are held in a list. This program works fine when its created and run as a...
16
Frinavale
by: Frinavale | last post by:
What I'd like to do is take a list and display it's items in a circle. For example (the order of the in the circle doesn't matter..except for Item1, it has to be at the top): Item1 ...
0
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...
0
jinu1996
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...
1
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...
0
agi2029
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.