Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bug with SSTab Control 7

Status
Not open for further replies.

DrJavaJoe

Programmer
Oct 3, 2002
2,143
0
0
US
I seem to have discovered a bug with the SSTab control and wanted to get any suggestion on a fix. So here it is:

Start a new Project1 and add a SSTab control and on the second tab add a command button then add the following code. In design mode make sure the second tab is selected then run the project. Now toggle the tabs and you will notice that the command button is only on the second tab, as it should be. Now go back to design mode and this time select the first tab and restart the app, now toggle the tabs you will notice that the command button is now on the first 2 tabs, when it should be only on the second.


Private Sub Form_Load()
SSTab1.Tab = 1
Command1.Left = 1000
Command1.Top = 1000
End Sub

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
If you can afford to place the code in the Initialize event then the problem will not occur.

Matt
 
That seems to have worked as a work around, thank you. Does anyone still have SP5 running, I'm curious if this is a new problem introduced with SP6?

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Isn't this to do with the way that the SSTab "hides" controls on inactive tabs? (it sets the .Left property to a -ve Value)

So in effect the form load code "Unhides" the button.

Not an answer, but a possible explanation?

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Yeah, I agree that seems to be the exact problem. I suppose another work around would be to manually move the controls off the tab based on the selected tab, though it would be nice if the control just worked as designed.

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
DrJavaJoe,

You are right...

It appears that either putting this code into Form_Activate or putting Command1 on a frame first will fix the bug you found.

I use SP5

Vladk
 
Though I would like to also point out that if you want the start up tab to be the first tab you need to do this even in the form_Initialize or for that matter anytime a control is moved on a particular tab you need to select that tab by setting the tab property then switch it back.

SSTab1.Tab = 1
Command1.Left = 1000
Command1.Top = 1000
SSTab1.Tab = 0

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Hi DrJavaJoe:

Per your request (original posting above), I tried to duplicate the bug. No success. The command button shows only on the second tab, regardless which tab was selected when starting the program.

VB6 Pro SP5
OS: Win98SE

Microsoft Tabbed Dialog Control 6.0 (SP5)
C:\Windows\System\TabCtl32.ocx
Version 6.00.9043

HTH,
Cassandra
 
Interesting vladk you are using sp5 also and are able to reproduce the error? My version of TabCtl32 is 6.1.97.82 how about you vladk?

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Stats:
VB6 SP5
TABCTL32.ocx Version 6.0.90.43
Windows 2000 Pro

Getting the same results as you are, Dr J.

-dave
 
DrJavaJoe,

I am using Tabctl32.ocx version 6.0.90.43 created November 19, 2003, 10:20:16 PM.

Vladk
 
Just in case you were wondering, DrJavaJoe, my copy of the TabCtl32.ocx is dated December 6, 2000.

If you wish me to try your exact coding, please feel free to send the project files (preferably Zipped) to me at:
kc0118_at_gto.net (replace the _at_ with the appropriate symbol.)

Cassandra
 
Thanks Cassandra but my entire source for the test is in my first post.

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Hi DrJavaJoe:

I revisited the original posting and have duplicated the problem as you described.

I noticed that if I comment out each line individually, only the Command1.Left appears to trigger the problem. Commenting out the Command1.Left line removes the bug. Commenting out either of the other two lines does not affect the bug. So, the bug appears to be in the Command1.Left property of the control.

Cassandra
 
Hi DrJavaJoe:

Another factor that I have discovered is that when the programs starts, with Tab0 selected prior to starting, the Command1.Left property is equal to the control's Left property minus 75000. So, if one places the control at Left=1560 on the form layout, Command1.Left will have a value of 1560 - 75000 = 73440.

Cassandra
 
CassandraR, thanks for your input. I think that's the same thing that mattKnight was pointing out. Basically the problem could be rectified by moving the controls manually off the tab by changing the left property just as the control is supposed to do automatically, just seems like a pain.

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
I've tracked down a copy of VB6 with nothing later than SP4 applied - and it exhibits the same behaviour that you describe, DrJavaJoe.

This means that I'm using TabCtl32.ocx version 6.0.84.18, dated 22 Feb 1999
 
Actually I'd like to give everyone a star for your input, thanks all.

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top