tabs and hiding

icemonster

Registered User.
Local time
Today, 16:52
Joined
Jan 30, 2010
Messages
502
so i have a tab, i put this on the code when it's clicked, yet somehow does not work.

Code:
Private Sub pgVitalSigns_Click()
Me.lstProgressNotes.visible = False
Me.txtEndDate.visible = False
Me.txtStartDate.visible = False
Me.cmdClear.visible = False
Me.cmdSearch.visible = False
End Sub

shouldn't it be working?

thanks for everybody's help lately. :) i really appreciate it!
 
Does it work when you put it under a button? The Click event of a tab control is practically useless.
 
it does, but then again, i want it to be hidden when they click on that tab, what's the best way or sample to simulate it that when i click the tab, the button would then be clicked too?
 
Use the Change event of the Tab Control and look at the TabIndex to determine which Tab you are entering.
 
so would be it like tabindex(1) then? something like that?
 
Just use a Select Case statement to determine what to do:

Code:
Select Case Me.MainTabControlNameHere.Pages(Me.TabControlNameHere.PageIndex).Name
Case "MyPageNameHere"
   ' Do whatever
Case "MyOtherPageNameHere"
  ' Do something Else
Case Else
   ' Do something if it is neither of those
End Select
You might have noticed that the code I used to check for the name was fairly long. But instead of using the page index numbers. I do that because you, or someone down the line who follows you may change the order of the tabs at some point and then it would break this code. So, using the page names will let the code work even if the tabs get re-ordered.
 
Select Case Me.MainTabControlNameHere.Pages(Me.TabControlNameHere.PageIndex).Name

so here would it be like,

Select Case Me.tbPNDVS.Pages(Me.tbPNDVS.PageIndex).Name

or it is wrong right?
 
my bad, it's actually

Select Case Me.tbPNDVS.Pages(Me.tbPNDVS).Name thanks bob!!
 

Users who are viewing this thread

Back
Top Bottom