|
-
May 11th, 2007, 05:17 AM
#1
Thread Starter
New Member
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
-
May 11th, 2007, 05:23 AM
#2
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?
-
May 11th, 2007, 06:23 AM
#3
Re: form not properly show up,while animated mouse cursor with loop working
 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.
-
May 12th, 2007, 08:11 AM
#4
Thread Starter
New Member
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.
-
May 12th, 2007, 11:52 AM
#5
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.
-
May 23rd, 2007, 06:56 AM
#6
Thread Starter
New Member
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
-
May 23rd, 2007, 06:59 AM
#7
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|