disable tabs

M

mcnews

i need to disable tabs until a button is clicked.
the button is on tab1 so need to be able disable all the other tabs on
load then enable them after a click.
this code makes them disabled but you can still click on them to see
the disabled fields.
form.tab2.disabled = false
but i don't want the tab to display.

tia
mcnewxp
 
D

Dirk Goldgar

in message
i need to disable tabs until a button is clicked.
the button is on tab1 so need to be able disable all the other tabs on
load then enable them after a click.
this code makes them disabled but you can still click on them to see
the disabled fields.
form.tab2.disabled = false

Um, do you mean ".Enabled", rather than ".Disabled"?
but i don't want the tab to display.

I'm not sure I understand you completelty, but you can hide the tab instead
of disabling it:

Me.tab2.Visible = False ' hide the tab completely

Later:

Me.tab2.Visible = True ' show the tab again
 
M

mcnews

in message



Um, do you mean ".Enabled", rather than ".Disabled"?


I'm not sure I understand you completelty, but you can hide the tab instead
of disabling it:

Me.tab2.Visible = False ' hide the tab completely

Later:

Me.tab2.Visible = True ' show the tab again

yeah, i meant enabled = false
and yeah, i know about .visible

what the users want is for the tab to be visible, but not clickable.
 
D

Dirk Goldgar

(re-sending, as my original reply hasn't appeared)

mcnews said:
yeah, i meant enabled = false
and yeah, i know about .visible

what the users want is for the tab to be visible, but not clickable.


In that case, you can use code in the tab control's Change event to prevent
it from changing to the disabled page. Something like this:

Private Sub tabMyTab_Change()

If Me.tabMyTab = Me.tab2.PageIndex Then
If Me.tab2.Enabled = False Then
' Set to a different tab page.
Me.tabMyTab = Me.tab1.PageIndex
End If
End If

End Sub
 
M

mcnews

(re-sending, as my original reply hasn't appeared)








In that case, you can use code in the tab control's Change event to prevent
it from changing to the disabled page. Something like this:

Private Sub tabMyTab_Change()

If Me.tabMyTab = Me.tab2.PageIndex Then
If Me.tab2.Enabled = False Then
' Set to a different tab page.
Me.tabMyTab = Me.tab1.PageIndex
End If
End If

End Sub

that's not too bad.....
thanks!
mcnewsxp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top