|
-
Apr 16th, 2002, 11:15 AM
#1
Thread Starter
Hyperactive Member
Painting the screen
Good afternoon, all. I have posted a question similar to this one before, but I wanted to see if I could get some fresh ideas. I have written a rather large project to handle data entry. Some of the forms have a lot of controls on them, and I am trying to get this thing finished and out the door.
But I am having a big problem with the screen painting. When the app closes one form and opens another, it takes a minute for the entire form to paint the screen. It's just looks sloppy.
I have used the LockWindow and UnLockWindow API calls to manage the screen flicker on updates, but I can't seem to solve this other problem with the forms loading.
Is there a way I can have the things load when the program starts up without actually displaying the screen? Will that help with the problem?
Any suggestions would be appreciated. Thanks
-
Apr 16th, 2002, 11:33 AM
#2
Frenzied Member
Well, i dunno if it's any help but
you can do that!
let say you have a splash screen and 3 form to load
in a module, in the main sub do
VB Code:
Public Sub Main()
Load frm1
Load frm2
Load frm3
frmSplash.Hide
Unload frmSplash
frm1.Show
End Sub
and set your splash screen to your opening form of your project!
put a timer on it with 100 for intervall and put this
VB Code:
Private Sub Timer1_Timer()
Timer1.Enabled = False
Call Main
End Sub
i hope it help a bit!
-
Apr 16th, 2002, 11:36 AM
#3
Not NoteMe
Re: Painting the screen
Originally posted by fllewis
it takes a minute for the entire form to paint the screen.
Wow, you must have a lot of controls!
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Apr 16th, 2002, 12:04 PM
#4
Thread Starter
Hyperactive Member
I'm thinking that surely there is some way to make sure the form is finished doing its thing before it's actually shown.
frm1.Load
frm2.Load
will work, but it loads the forms before it has retrieved info from the db, which is a big problem. So that option is out.
Any other ideas?
-
Apr 16th, 2002, 12:09 PM
#5
Frenzied Member
well i don't know then!
what are you doiing!!
what type of control?
is it because of variant?
... can you use api!
and can't help you man!
-
Apr 16th, 2002, 12:18 PM
#6
Thread Starter
Hyperactive Member
Here is the routine it is running through...a user searches on one form, an SQL statement is dynamically built, and then I call this set of procedures:
If rsSearch.RecordCount = 1 Then
LockWindow (frmSearch.hWnd)
frmMain.Show
gintCompanyID = rsSearch!CompanyID
gintContactID = 0
rsSearch.Close
Set rsSearch = Nothing
CleanCompany
CleanContact
CleanHistory
CleanToDo
CleanJobs
FillCompanyInfo
FillHistory ("Company")
FillToDo ("Company")
FillJobs
FillContactList
DisableContactButtons
frmSearch.Hide
frmMain.MainTabs.Tab = 0
UnLockWindow
Else
Most of those routines are either ensuring that controls are cleared or loading them with data from a db. You can see I have used the API to try the LockWindow, but unfortunately, this doesn't work so well when you are moving between forms. Ideally, I would like to get some control of Windows through the API to make sure that the form is painted before I show it. I don't know that that is possible? Do you?
I don't want to have to migrate some of this project to C++, but it is looking like one of the few options I know of. It just looks to sloppy to see the thing paint from the top down!!!
Thanks..
........
-
Apr 16th, 2002, 12:28 PM
#7
Frenzied Member
VB Code:
If rsSearch.RecordCount = 1 Then
'LockWindow (frmSearch.hWnd)
gintCompanyID = rsSearch!CompanyID
gintContactID = 0
rsSearch.Close
Set rsSearch = Nothing
CleanCompany
CleanContact
CleanHistory
CleanToDo
CleanJobs
FillCompanyInfo
FillHistory ("Company")
FillToDo ("Company")
FillJobs
FillContactList
DisableContactButtons
frmSearch.Hide
frmMain.MainTabs.Tab = 0
frmMain.Show 'what can't you show it here instead!!
'UnLockWindow
Else
-
Apr 16th, 2002, 12:35 PM
#8
Thread Starter
Hyperactive Member
It doesn't matter where I call the frmMain.Show. I think what I am going to need is to get control of how VB paints the screen.
Surely there is a way around this.
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
|
Click Here to Expand Forum to Full Width
|