473,763 Members | 5,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ListView vs. ListBox in my Program

I currently have a listbox in my program which I populate with data from
a random access file as follows:

For T = 1 To HighestPointID
FileGet(1, Point(T), T)
ListBox_Point.I tems.Add(T & " Lat: " & Point(T).Latitu de...)
Next

I end up with data in the following format in each ListBox line.
1 Lat: 42.5003, Long: -70.9249, Ele 161

The obvious advantage of ListView in Detail mode is that the information
can been presented in a more horizontally compact format, with the labels
shown only at the top of the ListView control.

My question deals with the possibility of another advantage to using
ListView:

Can the user click on any row/column combination in a ListView control
(SubItems as well as Items) and edit the contents, which could then be
passed back to the original array via an event detecting such a change?

Currently the user must select the relevant line in my program's listbox,
at which point the values are copied from the array into three TextBoxes.
After changing the values, the player must click a button to update the
array and regenerate the ListBox.

If a ListView control can ease functionality in that way I'll start
implementing it immediately.

Otherwise, since my lack of familiarity with Collections will make this
first excursion a damnably difficult, I'll put it further down on my to-
do list.

Thanks in advance for any helpful replies.

The Confessor
Jan 7 '06 #1
1 7717
See the technique here:

In-place editing of ListView subitems
http://www.codeproject.com/cs/miscct...ellEditors.asp

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio 2005, Visual Studio .NET,
VB6, VB5 and VBA
You can code, design and document much faster in VB.NET, C#, C++ or VJ#
Free resources for add-in developers:
http://www.mztools.com

"The Confessor" <in*****@reply. to.group> escribió en el mensaje
news:Xn******** *************** **********@130. 81.64.196...
I currently have a listbox in my program which I populate with data from
a random access file as follows:

For T = 1 To HighestPointID
FileGet(1, Point(T), T)
ListBox_Point.I tems.Add(T & " Lat: " & Point(T).Latitu de...)
Next

I end up with data in the following format in each ListBox line.
1 Lat: 42.5003, Long: -70.9249, Ele 161

The obvious advantage of ListView in Detail mode is that the information
can been presented in a more horizontally compact format, with the labels
shown only at the top of the ListView control.

My question deals with the possibility of another advantage to using
ListView:

Can the user click on any row/column combination in a ListView control
(SubItems as well as Items) and edit the contents, which could then be
passed back to the original array via an event detecting such a change?

Currently the user must select the relevant line in my program's listbox,
at which point the values are copied from the array into three TextBoxes.
After changing the values, the player must click a button to update the
array and regenerate the ListBox.

If a ListView control can ease functionality in that way I'll start
implementing it immediately.

Otherwise, since my lack of familiarity with Collections will make this
first excursion a damnably difficult, I'll put it further down on my to-
do list.

Thanks in advance for any helpful replies.

The Confessor

Jan 9 '06 #2

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

Similar topics

4
1846
by: Mr. B | last post by:
VB.net issue here. I've a strange event that I can't seem to figure out... On my Form, I've a TabControl (two Tabs)... On my first tab, I load an Ascii file and dump some info onto my ListView (which is located on my other Tab). Now IF I click on the 2nd Tab... the Info IS to be sorted out - as I've set
2
8628
by: Kanaiya | last post by:
hello how to put images in either listbox or listview.bye. -- With regards, Gangani Kanaiya.
6
2537
by: Vanessa | last post by:
With this program I can do one selection, but upon the second I get an error where ///////////////// is indicated. Please help. using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data;
4
9712
by: Paddy | last post by:
How do I select a subitem from a listview after clicking on the first column? Couldn't find it in MSDN. Thank you. Paddy.
2
9842
by: farmer | last post by:
I need to populate a listbox of other listview with selected listview items.although the following code works perfecty I want to use an Array (for various reasons) for Each ListItem In listview1.ListItems If ListItem.Checked = True Then listbox1.AddItem ListItem.Text next
1
1676
by: Michael M. | last post by:
HI all, When I add items to a Listview control, then clearing the items and adding more items my program seems to allocate a few KB of data and then not free the Memory. I noticed this about half way through writing a program and it's driving me a bit mad. I have posted a sub function below that I used to test this problem: The Sub is called every 4 seconds by a timer object, every 4 the seconds the memory usage of the program is...
6
5552
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...
2
10646
by: markliam | last post by:
I have a ListBox that is displaying a formatted string based on the contents of a DataSet. The purpose of the listbox is for the user to select an entry to delete, but I'm not sure how to match the listbox entry with the corresponding DataRow. The DataRow contains a unique id, but the id is not displayed in the formatted string that appears in the listbox. Is there a way to associate the id of the DataRow with the Listbox item so I...
6
5664
by: Rich Raffenetti | last post by:
I have a form with a listview control and a textbox. When I change focus from the listview to the textbox, the highlighted item on the listview loses the highlight. That is not the behavior I need. I am using VB2008 express. I see that the behavior of a similar program in VB6 is the same. When the controls are a listbox and a textbox, the highlighted item remains highlighted when changing focus to the textbox. So I might guess that...
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10144
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9997
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 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...
1
9937
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,...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8821
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, 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...
1
3917
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
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
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.