Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2010 > Visual Basic 2010 General Discussion
|
Visual Basic 2010 General Discussion For any discussions about Visual Basic 2010 topics which aren't related to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2010 General Discussion 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 July 17th, 2010, 08:18 AM
Authorized User
 
Join Date: May 2010
Posts: 70
Thanks: 4
Thanked 6 Times in 6 Posts
Send a message via Yahoo to GeneBuchite
Default Speed up those forms which use Comboboxes

Have you ever noticed how slowly a form loads when you place a combo box on it with the autoCompleteMode set to "SuggestAppend" and the AutoCompleteSource set to list? well one way I found to shorten this time was to set the autoCompleteMode And the AutoCompleteSource Parameters in the "Form_Activated " Sub Like this....
Code:
    Private Sub HelloUser_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
        ComboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend
        ComboBox1.AutoCompleteSource = AutoCompleteSource.ListItems

    End Sub
Leave both AutoComplete... Parameters Set to none in the desigh environment
That will speed up about 2 Seconds/Combobox.
but the real Speed up That I found comes from hiding the combobox in the design environment, then showing it in the Activated SUB.

After placing the combobox on the form Select "Visible" from the Properties Window. Set Visible to "False"

Then Add
Code:
        ComboBox1.Visible = True
In a button that the user will use before they need the combobox...
you cannot simply place it in the Activated Sub because it will not speed anything up. the user must make it visible by clicking a button.

This sped up the form loading process by about 2.3 SEC/Combobox!

Hope this helps someone as this solutin only cost me about 8 hours.

Last edited by GeneBuchite; July 17th, 2010 at 08:21 AM.. Reason: Clarity





Similar Threads
Thread Thread Starter Forum Replies Last Post
2 ComboBoxes in VB.NET vas General .NET 0 May 8th, 2008 08:51 AM
Link two ComboBoxes stepdev Excel VBA 0 May 22nd, 2006 02:30 PM
Corresponding values change in comboboxes gaurav_jain2403 ASP.NET 1.0 and 1.1 Professional 4 May 19th, 2006 10:03 AM
how can I speed up the opening of forms? Mihai B Access VBA 6 March 14th, 2005 06:05 AM
Menu is drawn behind comboboxes rmattila Javascript How-To 3 December 14th, 2004 05:13 AM





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