black_help
asked on
Putting frames on a tab
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
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
Activate the tab where you want the frame to appear before you set frastats(id).container = menustats.
ASKER
and how?
ASKER
frastats(id - 1).Container = menustats.Tabs.Item(id).In dex
' No error, but doesnt work
menu.Tab = 1
menustats.Tabs.Item(id).Se lected = True
frastats(id - 1).Container = menustats
'error
menu.Tab = 1
menustats.Tabs.Item(id).Se lected = True
menustats.Tabs.Item(id).Hi ghLighted = True
frastats(id - 1).Container = menustats.Tabs(id)
'no error, but doesnt work
menu.Tab = 1
menustats.Tabs.Item(id).Se lected = True
menustats.Tabs.Item(id).Hi ghLighted = True
frastats(id - 1).Container = menustats.Tabs(id).Index
'no error, but doesnt work
menu.Tab = 1
menustats.Tabs.Item(id).Se lected = True
menustats.Tabs.Item(id).Hi ghLighted = True
frastats(id - 1).Container = menustats.Tabs.Item(id).In dex
'no error, but doesnt work
menu.Tab = 1
menustats.Tabs.Item(id).Se lected = True
menustats.Tabs.Item(id).Hi ghLighted = True
frastats(id - 1).Container = menustats.Tabs.Item(id).Ca ption
'error: type mismatch if my name isnt a number
menu.Tab = 1
menustats.Tabs.Item(id).Se lected = True
menustats.Tabs.Item(id).Hi ghLighted = True
frastats(id - 1).Container = menustats.Tabs(id)
'error: type mismatch if my name isnt a number
menu.Tab = 1
menustats.Tabs.Item(id).Se lected = True
menustats.Tabs.Item(id).Hi ghLighted = True
frastats(id - 1).Container = menustats.SelectedItem
'error: type mismatch if my name isnt a number
menu.Tab = 1
menustats.Tabs.Item(id).Se lected = True
menustats.Tabs.Item(id).Hi ghLighted = True
frastats(id - 1).Container = menustats.SelectedItem.Ind ex
'no error, but doesnt work
menu.Tab = 1
menustats.Tabs.Item(id).Se lected = True
menustats.Tabs.Item(id).Hi ghLighted = 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
' No error, but doesnt work
menu.Tab = 1
menustats.Tabs.Item(id).Se
frastats(id - 1).Container = menustats
'error
menu.Tab = 1
menustats.Tabs.Item(id).Se
menustats.Tabs.Item(id).Hi
frastats(id - 1).Container = menustats.Tabs(id)
'no error, but doesnt work
menu.Tab = 1
menustats.Tabs.Item(id).Se
menustats.Tabs.Item(id).Hi
frastats(id - 1).Container = menustats.Tabs(id).Index
'no error, but doesnt work
menu.Tab = 1
menustats.Tabs.Item(id).Se
menustats.Tabs.Item(id).Hi
frastats(id - 1).Container = menustats.Tabs.Item(id).In
'no error, but doesnt work
menu.Tab = 1
menustats.Tabs.Item(id).Se
menustats.Tabs.Item(id).Hi
frastats(id - 1).Container = menustats.Tabs.Item(id).Ca
'error: type mismatch if my name isnt a number
menu.Tab = 1
menustats.Tabs.Item(id).Se
menustats.Tabs.Item(id).Hi
frastats(id - 1).Container = menustats.Tabs(id)
'error: type mismatch if my name isnt a number
menu.Tab = 1
menustats.Tabs.Item(id).Se
menustats.Tabs.Item(id).Hi
frastats(id - 1).Container = menustats.SelectedItem
'error: type mismatch if my name isnt a number
menu.Tab = 1
menustats.Tabs.Item(id).Se
menustats.Tabs.Item(id).Hi
frastats(id - 1).Container = menustats.SelectedItem.Ind
'no error, but doesnt work
menu.Tab = 1
menustats.Tabs.Item(id).Se
menustats.Tabs.Item(id).Hi
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
ASKER
I found it myself, I used the SStab instead of the Tabstrip, and I built in a wait loop
Now it works just fine :)
Now it works just fine :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hope this helps.