473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Slow dialogbox

Tom
I bring up a fairly complicated dialog box with:
form2.showDialog().
It takes about 0.5 seconds to come up partly because in
the Load event for the form I get some information from a
database to populate the fields on the form.
The total speed isn't really a problem. For some reason,
some of the text boxes show up without the new background
painted and then the rest of the form is drawn. I'd like
it to all show up at once.

Two questions:
Is there a better place than the load event to put my
database access stuff?
Is there a way to show nothing of the form until
everything is ready and then show it all at once?

Thanks
Nov 20 '05 #1
6 1811
You could try using a splash screen and hiding the base form until your load
is complete.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Tom" <an*******@discussions.microsoft.com> wrote in message
news:27*****************************@phx.gbl...
I bring up a fairly complicated dialog box with:
form2.showDialog().
It takes about 0.5 seconds to come up partly because in
the Load event for the form I get some information from a
database to populate the fields on the form.
The total speed isn't really a problem. For some reason,
some of the text boxes show up without the new background
painted and then the rest of the form is drawn. I'd like
it to all show up at once.

Two questions:
Is there a better place than the load event to put my
database access stuff?
Is there a way to show nothing of the form until
everything is ready and then show it all at once?

Thanks

Nov 20 '05 #2
This dialog box is brought up long after the application
has started. Is there some way I can do most of the work
of making the dialog box in advance, before doing the
showDialog?
-----Original Message-----
You could try using a splash screen and hiding the base form until your loadis complete.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Tom" <an*******@discussions.microsoft.com> wrote in messagenews:27*****************************@phx.gbl...
I bring up a fairly complicated dialog box with:
form2.showDialog().
It takes about 0.5 seconds to come up partly because in
the Load event for the form I get some information from a database to populate the fields on the form.
The total speed isn't really a problem. For some reason, some of the text boxes show up without the new background painted and then the rest of the form is drawn. I'd like it to all show up at once.

Two questions:
Is there a better place than the load event to put my
database access stuff?
Is there a way to show nothing of the form until
everything is ready and then show it all at once?

Thanks

.

Nov 20 '05 #3
Tom,
Have you considered: the constructor itself, a method you call before you
call ShowDialog? To name just a couple ideas...

Hope this helps
Jay

<an*******@discussions.microsoft.com> wrote in message
news:26*****************************@phx.gbl...
This dialog box is brought up long after the application
has started. Is there some way I can do most of the work
of making the dialog box in advance, before doing the
showDialog?
-----Original Message-----
You could try using a splash screen and hiding the base

form until your load
is complete.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Tom" <an*******@discussions.microsoft.com> wrote in

message
news:27*****************************@phx.gbl...
I bring up a fairly complicated dialog box with:
form2.showDialog().
It takes about 0.5 seconds to come up partly because in
the Load event for the form I get some information from a database to populate the fields on the form.
The total speed isn't really a problem. For some reason, some of the text boxes show up without the new background painted and then the rest of the form is drawn. I'd like it to all show up at once.

Two questions:
Is there a better place than the load event to put my
database access stuff?
Is there a way to show nothing of the form until
everything is ready and then show it all at once?

Thanks

.

Nov 20 '05 #4
Hi Tom,

Why is it a dialogform, I guess that in this case a normal show will be
better.

However I am not sure from what you told.

Cor
Nov 20 '05 #5
You could try to add your code into the constructor and see if this makes
any difference. The constrcutor is run before the page load event.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

<an*******@discussions.microsoft.com> wrote in message
news:26*****************************@phx.gbl...
This dialog box is brought up long after the application
has started. Is there some way I can do most of the work
of making the dialog box in advance, before doing the
showDialog?
-----Original Message-----
You could try using a splash screen and hiding the base

form until your load
is complete.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Tom" <an*******@discussions.microsoft.com> wrote in

message
news:27*****************************@phx.gbl...
I bring up a fairly complicated dialog box with:
form2.showDialog().
It takes about 0.5 seconds to come up partly because in
the Load event for the form I get some information from a database to populate the fields on the form.
The total speed isn't really a problem. For some reason, some of the text boxes show up without the new background painted and then the rest of the form is drawn. I'd like it to all show up at once.

Two questions:
Is there a better place than the load event to put my
database access stuff?
Is there a way to show nothing of the form until
everything is ready and then show it all at once?

Thanks

.

Nov 20 '05 #6
Tom

Thanks to the suggestions given in response to may
question, I have solved the problem. To be more
explicitly about the solution, I had some time consuming
code in the form load handler. This made the form show
partially and then a half second later the complete form
displayed. By opening the section of code at the top
that is labelled "Windows form designer generated code"
and putting my code just beneath the call to
InitializeComponent (where there is a comment that tells
you to put your intialization code), the problem was
fixed and the form now comes up all at once.

What I learned from this is that somewhere between
InitializeComponent and the Load event windows starts
displaying the window.

Tom
Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: jj | last post by:
Hi NG I have a form, where I can activate the search and replace dialogbox when pressing a button. My problem is that the dialogbox opens with the default that it should search for full match...
2
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! Is there a way to customize a dialogbox. I want buttons with the text: Yes, No, Yes to all, No to all.. Also a dialogbox with a CheckBox. Regards Martin
1
by: foreman | last post by:
Hello Everybody: I am trying out DialogBox, and I have been trying to press the OK Button on the dialogbox hoping I can receive the OK DialogResult to Main Form. Below is my OK button click...
0
by: John Marco | last post by:
I'm working on adding some dialogs to a DirectX app that I've been working on. The DirectX app by itself works fine, but when I try to define a DialogBox and call the DialogBox function, I get the...
3
by: majid | last post by:
When i show a webform as a dialogbox using showModalDialog script any postback event in dialogbox cause a new window pops up . How can i control the postback?
1
by: Tim_k | last post by:
Hi, I'm using showModalDialog to open a Window and return a user selected variable. Here is the code: retval=window.showModalDialog(sFrameName,window,sFeatures);...
4
by: Fendi Baba | last post by:
I am creating a simple project information database. In the project information form 1 have two subforms. one contains organization involved - many organzation can be involved - and another list of...
9
by: joemo2003 | last post by:
Please help. I created a custom dialogbox name "DialogBox". What i want is input values to the dialogbox, and those values appear on a textbox in Visio. After i creat the textbox and the dialogbox,...
1
by: PeteOlcott | last post by:
Does anyone know how to make a scalable image on a DialogBox? I am currently using a static Picture Control, can this be adapted to become scalable to the size of the DialogBox?
1
by: duwei | last post by:
I got a example, it GetBkColor from a HDC(the dc get from a DialogBox), but it BkColor always color white, dialogbox default BkColor is color like gray, how can I do to get the correct color for...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.