Results 1 to 8 of 8

Thread: Painting the screen

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    Washington, DC
    Posts
    422

    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

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    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:
    1. Public Sub Main()
    2.      Load frm1
    3.      Load frm2
    4.      Load frm3
    5.      frmSplash.Hide
    6.      Unload frmSplash
    7.      frm1.Show
    8. 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:
    1. Private Sub Timer1_Timer()
    2.      Timer1.Enabled = False
    3.      Call Main
    4. End Sub

    i hope it help a bit!

  3. #3
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051

    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.


  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    Washington, DC
    Posts
    422
    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?

  5. #5
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    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!

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    Washington, DC
    Posts
    422
    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..
    ........

  7. #7
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    VB Code:
    1. If rsSearch.RecordCount = 1 Then
    2. 'LockWindow (frmSearch.hWnd)
    3. gintCompanyID = rsSearch!CompanyID
    4. gintContactID = 0
    5. rsSearch.Close
    6. Set rsSearch = Nothing
    7. CleanCompany
    8. CleanContact
    9. CleanHistory
    10. CleanToDo
    11. CleanJobs
    12. FillCompanyInfo
    13. FillHistory ("Company")
    14. FillToDo ("Company")
    15. FillJobs
    16. FillContactList
    17. DisableContactButtons
    18. frmSearch.Hide
    19. frmMain.MainTabs.Tab = 0
    20. frmMain.Show 'what can't you show it here instead!!
    21. 'UnLockWindow
    22. Else

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    Washington, DC
    Posts
    422
    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
  •  



Click Here to Expand Forum to Full Width