Results 1 to 20 of 20

Thread: Adding items to the ListView of the other form[Resolved]

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Location
    Croatia
    Posts
    183

    Adding items to the ListView of the other form[Resolved]

    Hello guys,

    I am having problems with adding items on the ListView in the other form. Maybe I didn't explain it well, but I attached an example, so please help me to solve that problem.

    Thank you,
    Nebo
    Attached Files Attached Files
    Last edited by Nebo_vb; Apr 3rd, 2005 at 04:00 AM.

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: Adding items to the ListView of the other form

    Nebo_vb,

    You may have more chance of assistance if you re-post the attachement as a winzip file, being a common zip utility.




    Bruce.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Adding items to the ListView of the other form

    I have WinRAR

    First, add a module to the solution.

    VB Code:
    1. Module Module1
    2.  
    3.     Public f1 As New Form1
    4.  
    5.  
    6.     Sub Main()
    7.  
    8.         Application.Run(f1)
    9.  
    10.     End Sub
    11.  
    12. End Module

    Form 1:

    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         Dim forma2 As New Form2
    3.         forma2.Show()
    4.     End Sub

    Form 2:

    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         Dim ime As String
    3.         ime = TextBox1.Text
    4.  
    5.         f1.ListView1.Items.Add(ime)
    6.  
    7.         Me.Close()
    8.  
    9.     End Sub

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Location
    Croatia
    Posts
    183

    Re: Adding items to the ListView of the other form

    Bruce Fox, thanks for the advice! I attached the .zip file too.

    mendhak, can you pleas modify my code and attach it. Or tell me where the solution is?
    Attached Files Attached Files

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Adding items to the ListView of the other form

    Quote Originally Posted by Nebo_vb
    mendhak, can you pleas modify my code and attach it. Or tell me where the solution is?

    No, I've explained it perfectly. When I said "add a module to the solution", I meant, go into Solution Explorer and add a Module to your project.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Location
    Croatia
    Posts
    183

    Re: Adding items to the ListView of the other form

    Ok, I've added a module but it still doesn't work.

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Adding items to the ListView of the other form

    Show your code.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Location
    Croatia
    Posts
    183

    Re: Adding items to the ListView of the other form

    What should I show? The code is like you told me, I guess... I attached it.
    Attached Files Attached Files

  9. #9
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Adding items to the ListView of the other form

    Ah yes... I'm sorry. I forgot to tell you this.

    Click on the Project menu, click on WebApplication1 Properties.

    Change the Startup Object to Sub Main.

  10. #10
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Adding items to the ListView of the other form

    And I replied late too, because I had forgotten to press Submit.

    Whatever happened to psychic clicks?

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Location
    Croatia
    Posts
    183

    Re: Adding items to the ListView of the other form

    Ahh... Works now! Thanks guys!

  12. #12
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Adding items to the ListView of the other form

    Quote Originally Posted by kulrom
    Don't worry about that ... i already pointed out that credit is your!
    btw, Nebo ... you still didn't tell me where are you from?
    Odakle si?
    Cheers

    Are you bosnian?

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Location
    Croatia
    Posts
    183

    Re: Adding items to the ListView of the other form

    And what if I have more than just 2 forms like in the attachment ?
    Attached Files Attached Files

  14. #14

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Location
    Croatia
    Posts
    183

    Re: Adding items to the ListView of the other form

    Alo, ja san iz Hrvatske. A ti ?

    I'm from Croatia.

  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Location
    Croatia
    Posts
    183

    Re: Adding items to the ListView of the other form

    download the attachment I attached. It is the same thing, you just add items to form2. So, you start in Form1, ListView is in Form2 and you add items from Form3. Check it out and make it work please

  16. #16

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Location
    Croatia
    Posts
    183

    Re: Adding items to the ListView of the other form

    E hvala ti!

    Ja san iz Splita.

    Aj molin te ako mozes, napisi kako da svakom dodanom itemu stavi neki image is image lista. Image list sam vec ubacio i stavio slike u njega.

    Thanks dude! It really helped!

  17. #17

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Location
    Croatia
    Posts
    183

    Re: Adding items to the ListView of the other form

    da, mogu se izrazit kako ocu. onako na engleski neznam pola izraza pa neznam kako ljudima objasnit sta me muci.

    Napravi ti to u starome projektu, jer ionako samo experimentiran, nista posebno.

    I stavija san te na ICQ listu (tvoj AOL screen name) ali ne prijavljuje nikad da si online.

  18. #18
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Adding items to the ListView of the other form

    Hickory Dickory Dock. The mouse ran up the clock!

  19. #19

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Location
    Croatia
    Posts
    183

    Re: Adding items to the ListView of the other form[Resolved]

    Ma ok je, uspija san rijesit problem.

    Nego, zasto te ne vidim na ICQ listi da si online?

    p.s.
    Aj ako mos rijesi onaj drugi problem u mom topicu "Adding attachments..."
    It has been said that something as
    small as the flutter of a butterfly's
    wing can ultimately cause a typhoon
    halfway around the world...


  20. #20
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Adding items to the ListView of the other form[Resolved]

    nemojte koristiti ICQ! ICQ hoce da pojede vase bebe i siluje pse!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width