Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frame.visible problem

Status
Not open for further replies.

VBdevil

Programmer
Sep 19, 2002
75
IL
Hi,

I have a form which has several frames on it that contain textboxes and labels. In design-time I made some of the frames invisible (frame.visible=false).
Then in run-time when I try to do frame.visible = true it has no effect. The frame is still invisible. Why??
 
It should work the way you have it.
You may try the following two solutions :
1. The form may be overloaded with controls and you may need to refresh it as in frmMain.Refresh after making the frame visible.
2. It may reside behind another control and you may have to bring the control forward during design time.
Hope it helps
PK Odendaal
pko@942.co.za

 
Is this in VB6 with SP5?
If so have you got Option Explicit set?
Are the controls IN the frame not in front of the frame? (you have to draw the frame first then draw the controls inside the frame, you can't drag them in afterwards)

If so, this works for me, and toggles the frame and contents visible/hidden:

Private Sub Command1_Click()
Frame1.Visible = Not Frame1.Visible
End Sub
Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Do you have anything overlaped? Something like Frame1 is visible & then you set Frame2 as visible but can't see it because it's behind Frame1, which is still visible? If so refer to ZOrder.
 
It's still not working...

Here's a little bit more detail about the problem:

1. I have one frame that I set it's visible property to true in design time but when the form loads it loads the frame as frame1.visible = false, and when I do frame1.visible = true it stays frame1.visible = false.

2. I have a few other frames that I set their visible properties to false in design time. And again when I try to do frame2.visible = true it stays frame2.visible = false.

I don't understand why it insists on staying frame.visible = false...
I tried your solutions, but with no luck.
I'd appreciate any ideas...

By the way I'm using VB5.0.
 
Put a break at the point in your code where you set frame visibility and then follow the behavior step for step with the F8 key. If nothing else helps, make a second application with one frame and to command buttons. Button 1 turns the frame on, button 2 turns it off. Try this to see if your basic functionality is present. If it does not work, you may need to reinstall.
 
Check if the frame u r trying to make visible is a child of another frame which is invisible. if no, try this

Frame.visible=true
frame.zorder


All the best Praveen Menon
pcmin@rediffmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top