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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New problems with frames with in a frame with command buttons 1

Status
Not open for further replies.

ixian

Programmer
Jul 13, 2001
128
US
Anyone,

Okay my resolution was good on fmeMain with fmeList1 adn fmeList2
with this code
Private Sub cmdScripting_Click()
fmeList1.Visible = True
fmeList2.Visible = False
fmeList1.Top = 850
End Sub
Private Sub cmdlist2_Click()
fmeList2.Visible = True
fmeList1.Visible = False
fmeList2.Top = 850
End Sub

Private Sub Form_Load()
fmeMain.Visible = True
fmeList1.Visible = False
fmeList2.Visible = False

This works...
I decided to expand the scope based on my number of databases.. a total of 8
I change fme to the standred of grp

So I made 8 frames that on top of the grpMain with 8 command buttons to relate to each new frame.
I coded it all the same as the 3 frame issue with the extension of each cmd having 8 grp in it with the top issue(solved).
It does not make each visible on the click command.
Do I have to index them or what?
What would i do to get this done correctly?

Aaron
 
If you have so many of the same controls open, be sure to use control arrays. You'll want to make a control array of both the command buttons, as well as the frames, and be sure to keep them parallel (have frame(0) correspond to button(0) and so on...). This makes this entire process much easier:

Code:
Option Explicit
Dim nLastButton As Integer

Private Sub cmdButton_Click(Index As Integer)
    fmeList(nLastButton).Visible = False
    fmeList(Index).Visible = True
    nLastButton = Index
End Sub

Private Sub Form_Load()
    fmeList(0).Visible = True
    nLastButton = 0
End Sub

When doing this, set each Frame's .Visible to false. Best Regards and many Thanks!
Michael G. Bronner X-)

"Who cares how time advances? I am drinking [beer] today." Edgar Allan Poe
 
im get a index error... 0 doesnt exist

Aaron
 
In that case you don't have a control array. To create a control array, name each frame (in sequence!) to fmeList. Also rename each button in the corresponding order to cmdButton.
Best Regards and many Thanks!
Michael G. Bronner X-)

"Who cares how time advances? I am drinking [beer] today." Edgar Allan Poe
 
If you're still having problems, could you paste your code here, so i could take a look? Thanks. Best Regards and many Thanks!
Michael G. Bronner X-)

"Who cares how time advances? I am drinking [beer] today." Edgar Allan Poe
 
okay fixed the error .... now the cmd buttons there after the 0 one does not load the fmes there after.

Aaron
 
does each command button array item correspond with the each frame array item? Could you post your code? Best Regards and many Thanks!
Michael G. Bronner X-)

"Who cares how time advances? I am drinking [beer] today." Edgar Allan Poe
 
I have made each cmdButton index number is the same as grpList number.

Aaron
 
i'll need to look at your code to help you any further Best Regards and many Thanks!
Michael G. Bronner X-)

"Who cares how time advances? I am drinking [beer] today." Edgar Allan Poe
 
here is the code

Private Sub cmdButton_Click(Index As Integer)
grpList(nLastbutton).Visible = False
grpList(Index).Visible = True
nLastbutton = Index
End Sub

Private Sub Form_Load()
grpListing.Visible = True
grpList(0).Visible = True
nLastbutton = 0
End Sub


as what you stated above

Aaron

 
Is there an error message that pops up? I can't find anything in the code that would cause that problem. The only thing I could think of, is that it has to do with the settings of the control properties.

Best Regards and many Thanks!
Michael G. Bronner X-)

"Who cares how time advances? I am drinking [beer] today." Edgar Allan Poe
 
Micheal

now i fixed the error,
but now that if i click on other then the 1st one .. it i will not show the various frames(grp) beyond the grpList(0)

aaron
 
are these frames contained inside each other? All grpList member frames cannot be inside another grpList frame.

one thing i can do for you is write the code and send it to you, if you want to post your email address. Best Regards and many Thanks!
Michael G. Bronner X-)

"Who cares how time advances? I am drinking [beer] today." Edgar Allan Poe
 
armami@yahoo.com
I have the layered and staggered off each other

Aaron
 
I have the grpList(0) thru (7) under the grpListing.
 
Email is underway. Best Regards and many Thanks!
Michael G. Bronner X-)

"Who cares how time advances? I am drinking [beer] today." Edgar Allan Poe
 
No problem. Did you find out what the error was? Best Regards and many Thanks!
Michael G. Bronner X-)

"Who cares how time advances? I am drinking [beer] today." Edgar Allan Poe
 
Micheal,

thanks a million,

yes i didnt have one of the frames indexed in the right order.

Aaron


 
Hehe :)
Cool, glad I could help. Good luck on your project! Best Regards and many Thanks!
Michael G. Bronner X-)

"Who cares how time advances? I am drinking [beer] today." Edgar Allan Poe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top