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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSTab Control on VB 6.0 Form - multiple controls have focus

Status
Not open for further replies.

SBendBuckeye

Programmer
May 22, 2002
2,166
US
Hello All,

I have a VB 6 form with an SSTab control on it. The tab control has 4 tabs and when the first one receives the focus from any of the other tabs there are 2 embedded controls (both Comboboxes) which display highlighted like they have the focus. This is not an issue when the control first receives the focus, only if another tab is selected and then the first one is reselected. Any ideas??? Thanks!

Have a great day!

j2consulting@yahoo.com
 
Can you reproduce the error in a simple new project and post something that we can play with.

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'.
 
Thanks for your reply Doc.

Below is my SSTab control click event code. The line SelLength = 0 takes care of the problem, but I don't understand why I needed to do that in the first place.

Code:
Private Sub SSTabOrders_Click(PreviousTab As Integer)
    On Error Resume Next
    Select Case SSTabOrders.Tab
        Case sst_WorkOrder
            cmbDriver.SelLength = 0
            cmbWONumber.SetFocus
        Case sst_Customer
            txtCustName.SetFocus
        Case sst_Origin
            txtOrginAddr.SetFocus
        Case sst_Destination
            txtDestAddr.SetFocus
    End Select
    Err.Clear
    On Error GoTo 0
End Sub 'SSTabOrders_Click

Have a great day!

j2consulting@yahoo.com
 
There has to more to it than that. If I add a SSTab control and give it 4 tabs then place 2 combos on the first tab and 1 textbox on each of the other tabs and run the following code it does not duplicate the error.

Private Sub SSTab1_Click(PreviousTab As Integer)
On Error Resume Next
Select Case SSTab1.Tab
Case 0
'Combo1.SelLength = 0
Combo2.SetFocus
Case 1
Text1.SetFocus
Case 2
Text2.SetFocus
Case 3
Text3.SetFocus
End Select
Err.Clear
On Error GoTo 0
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'.
 
Hello Doc,

I think you are right. Unfortunately, this is all part of a large client app which I can't distribute. I appreciate your taking the time to respond.

Have a great day!

j2consulting@yahoo.com
 
SBendBuckeye,

Put a frame at each tab first, and put all your controls in the frames, then look if you still have this problem.

vladk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top