Results 1 to 7 of 7

Thread: form not properly show up,while animated mouse cursor with loop working

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2006
    Posts
    10

    form not properly show up,while animated mouse cursor with loop working

    I wrote the below. Its supposed to be working fine but in reality, the form with information(fillerformmw) did not come properly(its boundary with title could be seen but nothing inside the form became visible,i.e. inside the form a few sentences like 'Choosing the proper material...' were put on as lables but they did not become visible). However glass mouse cursor was shown and it returned to normal after the loop was completed. On the loop completion, the next form(sizemwform) showed up properly. One of my thought is that the loop may be consuming so many memory space that it did not show up.

    Any help/hint/suggestion/thought/referral to links-books would be gratefully appreciated.

    For every response I receive, I would try to give a hand anyway someone in this forum or other areas of life.
    Code:
    Private Sub mwprodselectLbl_Click()
    fillermwform.Show
    filename = App.Path + "\glas.ani"
        new_cursor = LoadCursorFromFile(filename)
        old_cursor = GetCursor()
        old_cursor = CopyCursor(old_cursor)
        SetSystemCursor new_cursor, OCR_NORMAL
        
        
    
    intSum = 0
    For intCounter = 1 To 100000000
    intSum = intSum + intCounter
    Next intCounter
    fillermwform.Hide
    SetSystemCursor old_cursor, OCR_NORMAL
        
    
    sizemwform.Show
    Unload Me
    End Sub

  2. #2
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: form not properly show up,while animated mouse cursor with loop working

    why are you telling the fillermwform to show then hide in the Loop?

  3. #3
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: form not properly show up,while animated mouse cursor with loop working

    Quote Originally Posted by vbwag92
    Code:
    intSum = 0
    For intCounter = 1 To 100000000
    intSum = intSum + intCounter
    Next intCounter
    You are going to have an Overflow error if intSum and intCounter are Integers, thats if it gets there, change them to Long.

    Its always advisable to put a few DoEvents inside loops so your system doesn't get bogged down.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  4. #4

    Thread Starter
    New Member
    Join Date
    Sep 2006
    Posts
    10

    Re: form not properly show up,while animated mouse cursor with loop working

    Many thanks to Hell-Lord for clarification query and KeithUK for hints.

    Actually I used Double for intSum and intCounter and that worked. Before using Double I tried with Long and it gave overflow error. However, with Double datatype mentionig, I have the problem of non-visibility of the label given inside the fillermwform as mentioned in the starting mail.

    Regarding show and Hide of fillermwform, actually this form is supposed to work as a information displaying form between starter form and third form. It is like the information about the program shown while a software being installed by the installer.

    thx n regards.

  5. #5
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: form not properly show up,while animated mouse cursor with loop working

    I was going by your variable names intSum and intCounter. These prefixes normally mean Integer.

    I wouldn't have thought that Long would have given a Overflow error, if it was Integer it would.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  6. #6

    Thread Starter
    New Member
    Join Date
    Sep 2006
    Posts
    10

    Re: form not properly show up,while animated mouse cursor with loop working

    as the problem was not resolved from the responses got here, later I posted the same to a usenet group. One response from there solved the problem. The solution is adding these two lines that ends infinite loop or somthing like that:
    fillermwform.Refresh
    DoEvents

    I gratefully appreciate everyone's response here. Every response brings me bit closer to the solution.thx a lot.
    "Larry Serflaten"

    <[email protected]> wrote:
    >
    >
    > > Its supposed to be working

    fine but in reality, the form with
    > > information(fillerformmw) did

    not come properly
    >
    > Try adding these two lines where

    indicated:
    >
    > > Private Sub

    mwprodselectLbl_Click()
    > > fillermwform.Show
    >
    > fillermwform.Refresh
    > DoEvents
    >
    > > filename = App.Path +

    "\glas.ani"
    >
    > ...
    >
    > LFS

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: form not properly show up,while animated mouse cursor with loop working

    If you consider this resolved, you could help us out by pulling down the Thread Tools menu and click the Mark Thread Resolved menu item. That will let everyone know that you have your answer.

    Thank you.

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