views:

48

answers:

1

Hi all,

I am looking for a contol either listbox or listview to support my requirements. Basically how my application looks is:

alt text

  1. The background should be black
  2. when the user clicks any 'row' the row should get highlighted witgh grey.
  3. The user will have the ability to search items in this control.

  4. For example , if one of the row displays 'This is the second Item in this car' If the user searches for Car, that corresponding row(s) should get highlighted with pink.

    1. The user should be able to search an item in this contol and specify a number to display the lines below the searched row.

For example, if the user Searched for 'car' 5, the rows that have car should get highlighted and their immediate 5 rows. I mean
Search Result :
car row
next row 1
next row 2
next row 3
next row 4
next row 5

car row
next row 1
next row 2
next row 3
next row 4
next row 5

  1. The user should be able to drag and drop the files and they should get opened in this 'control' i.e each row should display a new line till the EOF.

  2. The user will have the ability to right click on the row, context menu pops up displaying that row item.

  3. The contol should be able to display specific text items in a row(s) with different color.

Having said these things. I used to program in VC++6, VB6. But using those version now seems not realistic now as I lost touch. But if I have to use the latest 2008 versions, for which I do not have any experience seems scary.

So, If you are reading this , and you have got some experience in these fields or using controls that support my requirement, can you please let me know which programming language or IDE and Control should I use to develop this application.

PS: the image is made using mspaint and does not represent actual program.

A: 

As for language I would suggest either C# or VB.Net. They are both great languages and there is tons of support on the Internet for them. Just pick the one you are most comfortable with. As for a control that does what you are asking,

As for the control, it really depends on what platform you target. I have very little experience with WPF so can't help you with that. However, if you want to use WinForms, I would suggest the ListView control. It provides a lot of flexibility in terms of how you can use it. You will need to write the code to identify the rows and highlight them, but that shouldn't be too difficult once you understand how the ListView works.

Here are a couple tips if you do use ListView:

  • Set ListView.View to Details (this provides you with a grid-like control)
  • Set ListView.HideSelection to false
  • Set ListView.FullRowSelect to true
  • Set ListView.BackColor to Black
  • Set ListView.ForeColor to White
  • You can hide the column headers by setting ListView.HeaderStyle to None
  • If you want to support selecting multiple rows, you can set ListView.MultiSelect to true
  • To highlight row, set the ListViewItem.BackColor and ForeColor

The big let down of this control is that you don't have much control over the color of selected rows. There are techniques out there to control this, but it's not a simple property set. If you are interested, I think this question/answer might help.

Brian