 | 
September 5th, 2008, 06:04 AM
| | Member | | Join Date: Jul 2008
Posts: 33
| | how to change the Tab Caption of SSTab at run time in Visual Basic 6.0
hi
please tell, how to change the Tab Caption of SSTab at run time in Visual Basic 6.0
| 
September 5th, 2008, 09:11 AM
|  | Member | | Join Date: Dec 2007
Posts: 92
| |
Dear Ganesh
Add a command button in the form or in each Tab of SSTab. Say name of SSTab is SSTab1. Now put this command line in the click event of the command button:
SSTab1.Caption = "New Name"
If command button is outside SSTab1 then it will change caption of all the tabs at a time, if it is inside a tab then the caption of that particular tab only will get changed at run time. Hope it will solve your problem.
Always Believe in God.
| 
September 15th, 2008, 12:38 PM
| | Member | | Join Date: Jul 2008
Posts: 33
| | Quote: |
Originally Posted by smartchap Dear Ganesh
Add a command button in the form or in each Tab of SSTab. Say name of SSTab is SSTab1. Now put this command line in the click event of the command button:
SSTab1.Caption = "New Name"
If command button is outside SSTab1 then it will change caption of all the tabs at a time, if it is inside a tab then the caption of that particular tab only will get changed at run time. Hope it will solve your problem.
Always Believe in God. |
thanks SmartChap
hi
but i want to change the tab caption of SSTab according to textbox input at run time. for example if i give input three to text box, that creat three tab and Caption . otherwise if give two to text box that change the two tab and caption.
i change the textbox input frequently.
by
ganesh
| 
September 16th, 2008, 07:05 PM
|  | Member | | Join Date: Dec 2007
Posts: 92
| |
Dear Ganesh
Please try this:
Me.SSTab1.Tab = Val(Text1.Text)
'Set caption of the enabled tab = text in textbox, at run time:
Me.SSTab1.Caption = Text1.Text
Remember value in textbox must not be more than number of tabs in SSTab1 minus 1. Hope it solves ur query.
| 
September 17th, 2008, 12:06 PM
| | Member | | Join Date: Jul 2008
Posts: 33
| | Quote: |
Originally Posted by ganeshvkl hi
please tell, how to change the Tab Caption of SSTab at run time in Visual Basic 6.0 | hi
but i want to change the tab caption of SSTab according to textbox input at run time. for example if i give input three to text box, that creat three tab and Caption . otherwise if give two to text box that change the two tab and caption.
i change the textbox input frequently.
by
ganesh
| 
September 25th, 2008, 10:17 AM
|  | Member | | Join Date: Dec 2007
Posts: 92
| |
Mr. Ganesh
If I understood u properly try this code:
Private Sub Command1_Click()
If Val(Text1.Text) = 0 Then Text1.Text = "": Text1.SetFocus: Exit Sub
Me.SSTab1.Tabs = Val(Me.Text1.Text)
For i = 1 To Me.Text1.Text
Me.SSTab1.Tab = i - 1 'because tab no starts from 0.
Me.SSTab1.Caption = i
Next
End Sub
Hope it will work as per ur desire. If it is the solution plz reply so that thread is closed.
| 
September 25th, 2008, 04:19 PM
|  | Moderator | | Join Date: Oct 2006 Location: Bangalore
Posts: 1,292
| |
Hi,
Try This : -
Dim i As Integer
-
If Val(Text1.Text)<=0 Then Text1.Text= "1"
-
SSTab1.Tabs =Val(Text1.Text)
-
For i = 0 To Val(Text1.Text)-1
-
SSTab1.TabCaption(i) = "Tab Number : " & i
-
Next
-
Regards
Veena
| 
September 27th, 2008, 11:28 AM
|  | Member | | Join Date: Dec 2007
Posts: 92
| |
Dear QVeen
I think ur code is a replica of mine. Only thing is it has been shortened. Anyhow it is good.
|  |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over network members.
|