?
Solved

clone a combobox

Posted on 2005-05-05
2
Medium Priority
?
2,127 Views
Last Modified: 2012-06-21
What is the fastest code which will make a clone of a combobox?

I am trying to copy the items from one combobox to another, and I'm wondering if there is a faster way than looping through each item.

0
Comment
Question by:brokeMyLegBiking
2 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 1600 total points
ID: 13935520
There may be a faster way but I'm not seeing it yet...

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim items(ComboBox1.Items.Count - 1) As Object
        ComboBox1.Items.CopyTo(items, 0)
        ComboBox2.Items.Clear()
        ComboBox2.Items.AddRange(items)
    End Sub
0
 
LVL 4

Author Comment

by:brokeMyLegBiking
ID: 13937146
cool
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Integration Management Part 2
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question