Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: Show items in Listview of other form

Started 1 month, 1 week ago by Gagan.20
Hi all. I'm searching files whose code is written in form1 and displaying these files in the listview of form2. This code is written in form2 : Private Sub BGWorker_DoWork( ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BGWorker.DoWork For Each file As String In My.Computer.FileSystem.GetFiles(drive.Name, FileIO....
Site: CodeProject: Discussion Boards. Free source code and programming help  CodeProject: Discussion Boards. Free source code and programming help - site profile
Forum: Visual Basic / VB.NET  Visual Basic / VB.NET - forum profile
Total authors: 2 authors
Total thread posts: 12 posts
Thread activity: no new posts during last week
Domain info for: codeproject.com

Other posts in this thread:

Christian Graus replied 1 month, 1 week ago
Where does frmMain come from ? Why not use a delegate ?

Gagan.20 replied 1 month, 1 week ago
frmmain is the main form of program. where should I use a delegate?

Christian Graus replied 1 month, 1 week ago
does frmmain magically refer to the main form in VB.NET ? If not, it's a variable. What's the code that sets it's value ?

Gagan.20 replied 1 month, 1 week ago
See....frmMain is the main form and appears when program starts. Now when user search a file, form2 appears and actual code is written in form2 for searching files. But after searching files from form2 I want to display result on the listview of frmMain.

Christian Graus replied 1 month, 1 week ago
But this code is inside form2. frmMain is a variable inside form2. So, how is that variable's value set ? Where is it defined ?

Gagan.20 replied 1 month, 1 week ago
frmMain is not a variable. It is main form.

Christian Graus replied 1 month, 1 week ago
So the listview is a shared variable ?

Gagan.20 replied 1 month, 1 week ago
Yes. Listview is a shared control drawn on frmMain.

Christian Graus replied 1 month, 1 week ago
Wow - that's a bit of VB nastiness I didn't know about. So, what happens if you have more than one instance of the frmMain class ? Anyhow, VB sucks. You want to create a delegate so you can call it in your second form, and it calls a method in the first form, passing through the data.

Gagan.20 replied 1 month, 1 week ago
There is only a single instance of frmMain class. Yes I want to use a delegate to show searched files on the listview of frmMain.

 

Top contributing authors

Name
Posts
Christian Graus
6
user's latest post:
Show items in Listview of other...
Published (2009-11-04 00:47:00)
Gagan.20 wrote: There is only a single instance of frmMain class. Yes, but I just did a test and found that while in C#, I'd tell anyone who made their form controls static that that is a TERRIBLE design, it seems in VB it does that for you. And, given that VB is doing it, what happens if I have more than one instance of a form ? It's insane. VB sucks. OK, well, have you read up on delegates ? I'll be honest, I know a delegate...
Gagan.20
6
user's latest post:
Show items in Listview of other...
Published (2009-11-04 00:45:00)
There is only a single instance of frmMain class. Yes I want to use a delegate to show searched files on the listview of frmMain.

Related threads on "CodeProject: Discussion Boards. Free source code and programming help":

Related threads on other sites:

Thread profile page for "Show items in Listview of other form" on http://www.codeproject.com. This report page is a snippet summary view from a single thread "Show items in Listview of other form", located on the Message Board at http://www.codeproject.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity