Results 1 to 6 of 6

Thread: listview with frame

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    38

    listview with frame

    I have problme with listview1, I created listview1 with two categories in listview1, I added frame1 and frame2, if i click one of catagories in listview called "general", it will bring frame1 and hide frame2, how can i write that code! how can i write this code to make works by click on one of catagories in listviw1 to bring frame1 or frame2!

  2. #2
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: listview with frame

    it doesn't sound clear but i think the logic would take the discussion to the click event of the listview
    i can only give you the logic since it isn't clear enough for me
    VB Code:
    1. Private Sub ListView1_Click()
    2.     If LIstView1.SelectedItem.Text - "<category1>" then
    3.         Frame1.Visible = True
    4.         Frame2.Visible = False
    5.     else
    6.         Frame2.Visible = True
    7.         Frame1.Visible = False
    8.     End If
    9. End Sub
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    38

    Re: listview with frame

    thanks for reply but, i have tested is not working right, when I click "General" is works fine but when i click "secuirty" is not working only "General" working... the rest of "secuirty" and "backUP" is not showing, did i missed something!

    if i have to write while statment, how can I write that becuase is got me confused. please help me.
    VB Code:
    1. Private Sub ListView1_click()
    2.  
    3. If ListView1.SelectedItem.Text = "General" Then
    4. Frame1.Visible = True
    5. Frame2.Visible = False
    6. frame3.visible = false
    7.  
    8. Else
    9.  
    10. If ListView1.SelectedItem.Text = "Security" Then
    11. Frame1.Visible = False
    12. Frame2.Visible = True
    13. frame3.visible = False
    14.  
    15. else
    16.  
    17. If ListView1.SelectedItem.Text = "Security" Then
    18. Frame1.Visible = True
    19. Frame2.Visible = False
    20. frame3.visible = True
    21.  
    22. End if
    23. End If
    24. End If
    25. End sub
    Last edited by Hack; Mar 28th, 2006 at 12:42 PM. Reason: Added [vbcode] [/vbcode] tags for more clarity.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: listview with frame

    Try this
    VB Code:
    1. If ListView1.SelectedItem.Text = "General" Then
    2.     Frame1.Visible = True
    3.     Frame2.Visible = False
    4.     frame3.Visible = False
    5. ElseIf ListView1.SelectedItem.Text = "Security" Then
    6.     Frame1.Visible = False
    7.     Frame2.Visible = True
    8.     frame3.Visible = False
    9. Else
    10.     Frame1.Visible = True
    11.     Frame2.Visible = False
    12.     frame3.Visible = True
    13. End If

  5. #5

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    38

    Re: listview with frame

    still not working. is just not showing when click "Security" or "backup"...but is showing "general".

    i wonder why is not working! any idea why!

  6. #6
    New Member
    Join Date
    Apr 2006
    Posts
    10

    Re: listview with frame

    If ListView1.SelectedItem.Text = "General" Then
    call HideAllFrame
    Frame1.Visible = True
    end if

    If ListView1.SelectedItem.Text = "Security" Then
    call HideAllFrame
    Frame2.Visible = True
    end if

    public sub HideAllFrame()
    Frame1.Visible = False
    Frame2.Visible = False
    frame3.Visible = False
    end sub

    ' Try to check the listview index. Did you assign the correct one?

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