|
-
Aug 31st, 2000, 04:23 PM
#1
Thread Starter
Lively Member
i need to combobox with the same content in the same form ....
what's the best way to do this ???
-
Aug 31st, 2000, 04:27 PM
#2
Code:
For I = 0 To Combo1.ListCount - 1
Combo2.AddItem Combo1.List(I)
Next I
-
Aug 31st, 2000, 04:27 PM
#3
Monday Morning Lunatic
How about this?
Code:
Private Sub ReplicateCombo(src As ComboBox, dest As ComboBox)
dest.Clear
For i = 0 To src.ListCount - 1
dest.AddItem src.List(i)
dest.ItemData(i) = src.ItemData(i)
Next i
End Sub
Private Sub Command1_Click()
ReplicateCombo Combo1, Combo2
End Sub
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 31st, 2000, 04:35 PM
#4
Lively Member
Private Sub Form_Load()
Dim i%
For i = 1 To 10
Combo1.AddItem Str(i)
Next
For i = 0 To Combo1.ListCount - 1
Combo2.AddItem Combo1.List(i)
Next
End Sub
-
Aug 31st, 2000, 05:06 PM
#5
_______
Code:
Private Sub Form_Load()
'will fill as many combos as there are on a form with the same content
'mycontrol = control and increment is increment for forms
'
Dim ctlMyControl As Control
Dim intIncrement As Integer
Dim intCre As Integer
'
For intIncrement = 0 To Forms.Count - 1
For Each ctlMyControl In Forms(intIncrement).Controls
If TypeOf ctlMyControl Is ComboBox Then
For intCre = 1 To 10
With ctlMyControl
.AddItem intCre * Int(Rnd * 199)
End With
Next intCre
End If
Next ctlMyControl
'
Next intIncrement
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|