-
2nd form is not visible directly after loading
Hi there,
I wrote a program which opens a 2nd form on pressing a button. (Nothing special:-))
On this 2nd form there is a listview and its filled with severel data line
by line and it takes some seconds. My problem is now that this 2nd form
is not visible until the listview is filled up with all the data. I want
it visible at beginning of loading this form.
I tried to use the 'application.doevents()' statement after definding the
listview, so that it is displayed after that... But it doesn't work!
Has anyone an idea how to make this form driectly visible after loading?
Best regards
> Erik
-
Re: 2nd form is not visible directly after loading
I'm no expert on this, but it could be that you are loading the data in the
Load event, and the form won't actually become visible until after the Load
event has completed. There is nothing you can do about this behavior. It
is the way the thing is designed. In VB6, there was an Activate event, and
it fired after the form painted the first time. There was also the paint
event (you could load on the first one, then ignore any further paint events).
I haven't looked at this in VB.NET, but I'd be surprised if you could not
solve your problem pretty simply by just using a different event.
"Erik Bartmann" <message@shadowworker.de> wrote:
>
>Hi there,
>
>I wrote a program which opens a 2nd form on pressing a button. (Nothing
special:-))
>On this 2nd form there is a listview and its filled with severel data line
>by line and it takes some seconds. My problem is now that this 2nd form
>is not visible until the listview is filled up with all the data. I want
>it visible at beginning of loading this form.
>I tried to use the 'application.doevents()' statement after definding the
>listview, so that it is displayed after that... But it doesn't work!
>
>Has anyone an idea how to make this form driectly visible after loading?
>
>Best regards
>
>> Erik
-
Re: 2nd form is not visible directly after loading
G'day
>but I'd be surprised if you could not
>solve your problem pretty simply by just using a different event.
If the poulation of the list box is taking a while, you could also populate
it via an async method:
ie
Put list box population into a sub on the form, with the following signature
Private Sub PopulateList(State as Object)
In Sub New, put the following:
System.Threading.ThreadPool.QueueUserWorkItem(AddressOf PopulateList)
Cheers,
Paul
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks