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

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Listview problem

Hey,

I need help with my listview control. Here's my code:

Dim frm As New Form2()

Dim lvItem As New ListViewItem

Catch ex As Exception

MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")

StatusBar.Panels(0).Text = "Not Connected: Error"

lvItem = frm.lvErrorLog.Items.Add(Date.Now)

lvItem.SubItems.Add(ex.Message)

End Try

There is a "Try" command, I just didn't show it. Here's my problem: I'm trying to add an item to a listview from one form to another. Like this, Form1 gets the error, and tells form2 to place the error in its listview.

Thanks.

Nov 20 '05 #1
1 908
Hi,

Try something like this.

Dim frm As New Form2

frm.Show()

Try

Dim x, y, z As Integer

x = 10

y = 0

z = x / y

Catch ex As Exception

Dim lvi As New ListViewItem(Now.ToShortDateString)

lvi.SubItems.Add(ex.ToString)

frm.ListView1.Items.Add(lvi)

End Try

Ken

"Donald Smith" <St**************@Cox.net> wrote in message news:xQsVb.7816$Le3.3342@okepread04...
Hey,

I need help with my listview control. Here's my code:

Dim frm As New Form2()

Dim lvItem As New ListViewItem

Catch ex As Exception

MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")

StatusBar.Panels(0).Text = "Not Connected: Error"

lvItem = frm.lvErrorLog.Items.Add(Date.Now)

lvItem.SubItems.Add(ex.Message)

End Try

There is a "Try" command, I just didn't show it. Here's my problem: I'm trying to add an item to a listview from one form to another. Like this, Form1 gets the error, and tells form2 to place the error in its listview.

Thanks.

Nov 20 '05 #2

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

Similar topics

0
by: Steph. | last post by:
I use a ListView in a form to display Data from an SQL db. My problem is that I can fill the listview in less than a second when I show the form AFTER filling the listview, but I take 35...
15
by: Wiktor Zychla | last post by:
today we've found a critical issue regarding the ListView from Windows.Forms. it was confirmed on several machines with Win2K and XP. here's the problem: create a ListView with about 50000 rows....
0
by: Sérgio Almeida | last post by:
Greetings I have a problem using listview control. Well, I belive that this is not realy a problem, but it's consuming me precious time. Here is the scenario (an example of my problem). I...
3
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,...
4
by: firefox | last post by:
Hola Foro!, tengo una rutina que permite agregar varios elementos o items de una sola vez en un ListView. Lo que sucede es que en el momento que se añaden los items al ListView se pone todo blanco,...
4
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...
3
by: Martin Panggabean | last post by:
Hello All, I've kind a logic problem ... I want to fill the listView control in VB.NET with data in my mySql table using Datareader object component. But It seems that the way of how listView...
12
by: garyusenet | last post by:
I have had no replies to my previous post so perhaps I didn't write it good enough. Please excuse new thread but i wanted to break from the last thread hopefully this thread will be better. ...
4
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea...
2
by: =?Utf-8?B?UGhpbGlw?= | last post by:
I am attempting to insert a simple record with LinqDataSource from a ListView, however I always get a message saying "....LinqDataSource 'dataSource' has no values to insert. Check that the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.