Solved

Putting frames on a tab

Posted on 2004-04-23
7
455 Views
Last Modified: 2012-08-13
Hey,

This is what I have:
An SStab with 3 tabs called menu
The second tab contains a tabstrip with 1 tab calles menustats
On that 1 tab there is a frame and on that frame there are some labels

Now, I have a function that:
1) creates a tab in the tabstrip
2) creates a frame
3) create the new labels

those new labels are put on that new frame
But now that new frame should be put on the new tab
and that wont work

How can I fix that?

The new frames are loaded onto the form and are called frastats(0) --> frastats(number)

I tried:
frastats(id).container = menustats
I tried frastats(id).container = menustatstabs(id)
...


There is one more thing:
when I compile my program with the first tab of the SStab selected I dont see the created frames on the newly created tabstrip tab
But when I compile when the second tab of the SStab is selected, it does work.

This is the main part:

        menustats.Tabs.Add id, ,newname
        Load frastats(id - 1)
        frastats(id - 1).ZOrder
        ' Position the frame over the TabStrip.
        PositionFrame frastats(id - 1)

with positionFrame:

Private Sub PositionFrame(ByVal the_frame As Frame)
Dim frame_left As Single
Dim frame_top As Single
Dim frame_width As Single
Dim frame_height As Single

    frame_left = frastats(0).Left
    frame_top = frastats(0).Top
    frame_width = frastats(0).Width
    frame_height = frastats(0).Height

    the_frame.Move frame_left, frame_top, frame_width, frame_height
    the_frame.Caption = ""
End Sub
0
Comment
Question by:black_help
7 Comments
 
LVL 1

Expert Comment

by:RobertCezar
ID: 10901883
Have you tried placing ALL items into "Pictures" on each tab as the Parent Container?  This has worked well for me in the past.  Another thing you can do (it's not pretty but it works), is to move the above mentioned Pictures "outside" the tabs and simply use the Tab Index (1-n) to set the"visible" properties of the picture boxes.

Hope this helps.



 
0
 
LVL 5

Expert Comment

by:JMoon5FTM
ID: 10902237
Activate the tab where you want the frame to appear before you set frastats(id).container = menustats.
0
 

Author Comment

by:black_help
ID: 10902375
and how?
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:black_help
ID: 10907496
frastats(id - 1).Container = menustats.Tabs.Item(id).Index
' No error, but doesnt work

menu.Tab = 1
menustats.Tabs.Item(id).Selected = True
frastats(id - 1).Container = menustats
'error

        menu.Tab = 1
        menustats.Tabs.Item(id).Selected = True
        menustats.Tabs.Item(id).HighLighted = True
        frastats(id - 1).Container = menustats.Tabs(id)
'no error, but doesnt work

        menu.Tab = 1
        menustats.Tabs.Item(id).Selected = True
        menustats.Tabs.Item(id).HighLighted = True
        frastats(id - 1).Container = menustats.Tabs(id).Index
'no error, but doesnt work

        menu.Tab = 1
        menustats.Tabs.Item(id).Selected = True
        menustats.Tabs.Item(id).HighLighted = True
        frastats(id - 1).Container = menustats.Tabs.Item(id).Index
'no error, but doesnt work

        menu.Tab = 1
        menustats.Tabs.Item(id).Selected = True
        menustats.Tabs.Item(id).HighLighted = True
        frastats(id - 1).Container = menustats.Tabs.Item(id).Caption
'error: type mismatch if my name isnt a number

        menu.Tab = 1
        menustats.Tabs.Item(id).Selected = True
        menustats.Tabs.Item(id).HighLighted = True
        frastats(id - 1).Container = menustats.Tabs(id)
'error: type mismatch if my name isnt a number

        menu.Tab = 1
        menustats.Tabs.Item(id).Selected = True
        menustats.Tabs.Item(id).HighLighted = True
        frastats(id - 1).Container = menustats.SelectedItem
'error: type mismatch if my name isnt a number

        menu.Tab = 1
        menustats.Tabs.Item(id).Selected = True
        menustats.Tabs.Item(id).HighLighted = True
        frastats(id - 1).Container = menustats.SelectedItem.Index
'no error, but doesnt work

        menu.Tab = 1
        menustats.Tabs.Item(id).Selected = True
        menustats.Tabs.Item(id).HighLighted = True
        Load frastats(id - 1)
        With frastats(id - 1)
            .Container = menustats.Tabs(id)
            Stop
        End With
'Error: type mismatch if my name isnt a number


But what I notice when I use one of the no-errors above is that:
    MsgBox frastats(0).Container
    MsgBox frastats(1).Container
    MsgBox frastats(2).Container

gives 0 every time, so I guess this just doesnt do a thing .container = tabs(id).index
0
 

Author Comment

by:black_help
ID: 10908761
I found it myself, I used the SStab instead of the Tabstrip, and I built in a wait loop
Now it works just fine :)
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 10937863
Closed, 250 points refunded.
PashaMod
Community Support Moderator
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Input past end of file vbs script 9 91
VB error "Type mismatch" 2 53
How does CurrentUser work? 10 37
Publisher:   Unknown     VB.exe Application 1 19
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question