Small Combo / SSTab Problem
If anyone can help with this small problem, I'd be grateful.
Starting from scratch, I've created a new form, upon which I placed an SSTab control (Microsoft Tabbed Dialog Control 6.0).
On the first page of the SSTab control, I've created 2 combo boxes.
I've then coded the Form_load routine with the following, in order to add items to the combo boxes and set the text:
' Add items to combo boxes
' 1st Combo
Combo1(0).AddItem "First Item"
Combo1(0).AddItem "Second Item"
Combo1(0).AddItem "Third Item"
' 2nd Combo
Combo1(1).AddItem "First Item"
Combo1(1).AddItem "Second Item"
Combo1(1).AddItem "Third Item"
' Set text of combo boxes
Combo1(0).Text = "First Item"
Combo1(1).Text = "Second Item"
All pretty straight-forward stuff.
Problem arises when I select another tab during run-time, and then back again. The contents of all combo boxes have been high-lighted.
Is there any way to prevent this? The actual form I have created is loaded with combos, and it's quite annoying. :)
[1180 byte] By [
Laurel] at [2007-11-20 11:47:25]

# 3 Re: Small Combo / SSTab Problem
Thanks for the suggestion.
It is a solution, but in order to clear any combos on the page, I need to set focus on each combo in turn. It's a little bit of a pain when I have so many combos in my actual application.
I would have thought that there is a reason why this is happening, and some way to prevent it?
Laurel at 2007-11-9 19:34:27 >

# 5 Re: Small Combo / SSTab Problem
Just to clarify, when I say the text is high-lighted, I mean that the combo text is inverted, as when text is selected in a document.
Thanks for the suggestion WoF. Changing combobox.style to 2 does work, but prevents me from being able to add new lines of text to the combo, so it's not really suitable.
Any other suggestions?
Laurel at 2007-11-9 19:36:24 >

# 6 Re: Small Combo / SSTab Problem
I was afraid you wanted to enter text...
Private Sub SSTab1_Click(PreviousTab As Integer)
If SSTab1.Tab = 0 Then
Combo1(0).SetFocus
Combo1(1).SetFocus
SSTab1.SetFocus
End If
End Sub
Is the only thing I can think of ...
If you keep organizing your Combos as an array a loop is more suitable:
...
Dim i%
For i = 0 To Combo1.UBound
Combo1(i).SetFocus
Next
SSTab1.SetFocus
WoF at 2007-11-9 19:37:29 >
