Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old September 5th, 2008, 06:04 AM
Member
 
Join Date: Jul 2008
Posts: 33
Default 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
Reply
  #2  
Old September 5th, 2008, 09:11 AM
smartchap's Avatar
Member
 
Join Date: Dec 2007
Posts: 92
Default

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.
Reply
  #3  
Old September 15th, 2008, 12:38 PM
Member
 
Join Date: Jul 2008
Posts: 33
Default

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
Reply
  #4  
Old September 16th, 2008, 07:05 PM
smartchap's Avatar
Member
 
Join Date: Dec 2007
Posts: 92
Default

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.
Reply
  #5  
Old September 17th, 2008, 12:06 PM
Member
 
Join Date: Jul 2008
Posts: 33
Default

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
Reply
  #6  
Old September 25th, 2008, 10:17 AM
smartchap's Avatar
Member
 
Join Date: Dec 2007
Posts: 92
Default

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.
Reply
  #7  
Old September 25th, 2008, 04:19 PM
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,292
Default

Hi,

Try This :

Expand|Select|Wrap|Line Numbers
  1. Dim i As Integer
  2. If  Val(Text1.Text)<=0 Then Text1.Text= "1"
  3. SSTab1.Tabs =Val(Text1.Text)
  4. For i = 0 To Val(Text1.Text)-1
  5.     SSTab1.TabCaption(i) = "Tab Number : " & i
  6. Next
  7.  
Regards
Veena
Reply
  #8  
Old September 27th, 2008, 11:28 AM
smartchap's Avatar
Member
 
Join Date: Dec 2007
Posts: 92
Default

Dear QVeen
I think ur code is a replica of mine. Only thing is it has been shortened. Anyhow it is good.
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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.
Post your question now . . .
It's fast and it's free

Popular Articles