Re: something missing myself
The last 2 are looking for the same string.... Is that code copy and pasted?
Re: something missing myself
yes sorry is suppose to be
If ListView1.SelectedItem.Text = "General" Then
Frame1.Visible = True
Frame2.Visible = False
frame3.visible = false
Else If ListView1.SelectedItem.Text = "Security" Then
Frame1.Visible = False
Frame2.Visible = True
frame3.visible = False
elseIf ListView1.SelectedItem.Text = "Backup" Then
Frame1.Visible = True
Frame2.Visible = False
frame3.visible = False
End If
End If
End sub
but still not working, wonder why! any idea!
Re: something missing myself
"General" and "Backup" are both showing Frame1.
Re: something missing myself
Well, for "Backup" you're showing frame1 again.... same as you are for "General" ....
The next question I have is what event are you using to run this code?
-tg
Re: something missing myself
why the world I'm so monkey that im typing to fast ane end up into wrong code. the code is suppose to be
If ListView1.SelectedItem.Text = "General" Then
Frame1.Visible = True
Frame2.Visible = False
frame3.visible = false
Else If ListView1.SelectedItem.Text = "Security" Then
Frame1.Visible = False
Frame2.Visible = True
frame3.visible = False
elseIf ListView1.SelectedItem.Text = "Backup" Then
Frame1.Visible = false
Frame2.Visible = False
frame3.visible = True
Any idea why!
or do i have to write zorder statments!
End If
End If
End sub
Re: something missing myself
As tg said, we'd need to know what event you're using to run your code.
Also, that code can be simplified to:
VB Code:
Frame1.Visible = ListView1.SelectedItem.Text = "General"
Frame2.Visible = ListView1.SelectedItem.Text = "Security"
Frame3.Visible = ListView1.SelectedItem.Text = "Backup"
Re: something missing myself
____________________________________________________
Frame1.Visible = ListView1.SelectedItem.Text = "General"
Frame2.Visible = ListView1.SelectedItem.Text = "Security"
Frame3.Visible = ListView1.SelectedItem.Text = "Backup"
_____________________________________________________
that have same problme again, One frame (General) overlay the other frame (Security), thired frame overlay the other frame (backup), so when user selected options (general) is works fine then i click "options" for security is not working, and if i click backup is works fine with frame.
so what went wrong with that!
1 Attachment(s)
Re: something missing myself
That code was not meant to be a solution to your problem, just a shorter way of writing what you had posted in post #6.
You still haven't told us how you are calling that code. You should probably be using the Click event, is that what you're doing?
VB Code:
Private Sub ListView1_Click()
Frame1.Visible = ListView1.SelectedItem.Text = "General"
Frame2.Visible = ListView1.SelectedItem.Text = "Security"
Frame3.Visible = ListView1.SelectedItem.Text = "Backup"
End Sub
Here's an example:
Re: something missing myself
I think the ItemClick event is a better choice over the Click event.
Re: something missing myself
I've never really used a ListView, so I suspected there might have been something better :D
1 Attachment(s)
Re: something missing myself
thanks for file, still not working one of mine, i enclosed my file and you see what the problme i have. I really appreication if anyone can help me what did i missed. and send file back so i can learn my mistake thanks.
Re: something missing myself
The problem is that you've put the security frame inside the general frame and the user frame inside the back up frame.
Re: something missing myself
thanks for reply, If you fixed that file, i apprication if you can send me back so i can learn myself becuase i still not sure where to put if not suppose to put inside of frame. thanks.
Re: something missing myself
i don't have one of the controls you have so the project would be resaved with that control missing if i change it (i think). Here's what you do:
- Click on the security frame
- Press Ctrl + X
- Click on the form
- Press Ctrl + V
- Move the frame to where you want it
then repeat that for the user frame
Re: something missing myself
thanks so much, you been helpful lots, can you tell me why we have to do this way by copy and paste over !
so i do have same problme with user, all i have to do copy and paste over right!
Re: something missing myself
when you were drawing (or pasting) your frames you accidently drew some of them inside others. That means if the parent frame was not visible then neither was the frame within it, hence it not being shown when you set it's visible state to True.
Just make sure that you're always pasting controls into container you want them to be in. Frames & pictureboxes can be containers for controls as well as the form itself.
Don't forget to mark this thread resolved :thumb:
Re: something missing myself
A Frame, as you probably know, is a container object. So one Frame can contain other controls... This is the problem you have... Your Frame is contained in another Frame instead of being contained directly on the Form.
So that is why you should cut and paste the frame, so it is contained on the Form instead of inside the other Frame. I hope this makes sense to you.
Re: something missing myself
oh ok great thanks. last things is that if I want to put button or text filed to one of the frame, why is showing to all of frame! how can i do that to show one of frame rather then all frames!
Re: something missing myself
I don't really understand. What do you mean by "why is it showing to all of frame"? If i put a control on one of the frames then it's only visible when that frame is visible
Re: something missing myself
The controls that should go on a Frame must be "drawn" on the Frame and not on the Form.