Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 12th, 2008, 06:57 PM
Registered User
 
Join Date: Feb 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How do I delete all elements of a combobox

How do I clear out all of the elements in a system.string before the combobox is used again during runtime? Below is the code for how I load it...

Private Sub printout(ByRef letters As String(), ByRef grades As String())

        Dim x As Integer
        Dim strarray(25) As System.String
        'Dim strarray(25) As String
        'strarray = New String()

        For x = LBound(strarray) To UBound(strarray)
            strarray(x) = letters(x) & " - " & grades(x) 'loads results into array
        Next

        TextBox1.Text = "" 'clears textbox
        ComboBox1.Items.AddRange(strarray) 'loads combobox with values

    End Sub

 
Old February 13th, 2008, 03:49 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I don't follow what it is you want to do, and where you want to do it at.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to delete file System.IO.Delete error maricar C# 13 March 14th, 2014 06:50 AM
php/mysql delete button and delete query dungey PHP Databases 17 April 11th, 2009 12:24 PM
Filling Combobox with value from other Combobox ayazhoda Access VBA 6 June 5th, 2007 04:58 AM
elements with same name kfir XML 8 May 1st, 2006 07:42 AM
how to delete a row when click delete hyperlink naveenkumarg1 Pro JSP 1 August 16th, 2004 01:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.