this makes NO SENSE! help... 
Author Message
 this makes NO SENSE! help...

This KeyDown procedure (used on a textbox) work FINE on VB4... but doesnt
work in VB5.

if vbkeyreturn then
  image1.visible = false
  image2.visible = true
  currently_displayed_formname.hide
  soon_to_be_displayed_formname.show
endif

Ok, in VB4, this work... it correctly turns image1 invisible, turns image2
visible, hides the form, the shows another form.

THIS DOESN'T WORK IN VB5!!  ack!   it works like this in VB5:  It correctly
turns image1 invisible, NEVER shows image2, hides the form, and shows
another form.   WHY does the .visible = true not happen like it is supposed
to?  can anyone give me a clue?

BTW - I did try removing the formname.hide and formname.show and THEN the
image2 turns visible, but it won't do it IF the forms are changed.... what's
up?


jesse



Wed, 04 Oct 2000 03:00:00 GMT  
 this makes NO SENSE! help...

try putting Doevents after the image2.visible = true.  VB may not have
enough time inbetween showing a form, which is complex, to show the image
control properly.

hope that helps

Quote:

>This KeyDown procedure (used on a textbox) work FINE on VB4... but doesnt
>work in VB5.

>if vbkeyreturn then
>  image1.visible = false
>  image2.visible = true
>  currently_displayed_formname.hide
>  soon_to_be_displayed_formname.show
>endif

>Ok, in VB4, this work... it correctly turns image1 invisible, turns image2
>visible, hides the form, the shows another form.

>THIS DOESN'T WORK IN VB5!!  ack!   it works like this in VB5:  It correctly
>turns image1 invisible, NEVER shows image2, hides the form, and shows
>another form.   WHY does the .visible = true not happen like it is supposed
>to?  can anyone give me a clue?

>BTW - I did try removing the formname.hide and formname.show and THEN the
>image2 turns visible, but it won't do it IF the forms are changed....
what's
>up?


>jesse



Thu, 05 Oct 2000 03:00:00 GMT  
 this makes NO SENSE! help...

--
Ron Ruble
Raffles Software Development, Inc.
Patient - Doctor, it hurts when I do this!
Doctor - Then don't do that.

Quote:

>try putting Doevents after the image2.visible = true.  VB may not have
>enough time inbetween showing a form, which is complex, to show the image
>control properly.

>hope that helps

Or a form.Refresh.

Jesse, it makes perfect sense. Microsoft sped up the forms engine
enormously in VB 5, and ALL paint events are low priority. It worked
in VB 4 just because VB 4 was designed to run slower, and paint
images completely before proceeding to the next line of code.

Quote:

>>This KeyDown procedure (used on a textbox) work FINE on VB4... but doesnt
>>work in VB5.

>>if vbkeyreturn then
>>  image1.visible = false
>>  image2.visible = true
>>  currently_displayed_formname.hide
>>  soon_to_be_displayed_formname.show
>>endif

<snip>


Thu, 05 Oct 2000 03:00:00 GMT  
 this makes NO SENSE! help...

Quote:

>--
>Ron Ruble
>Raffles Software Development, Inc.
>Patient - Doctor, it hurts when I do this!
>Doctor - Then don't do that.


>>try putting Doevents after the image2.visible = true.  VB may not have
>>enough time inbetween showing a form, which is complex, to show the image
>>control properly.

>>hope that helps

>Or a form.Refresh.

>Jesse, it makes perfect sense. Microsoft sped up the forms engine
>enormously in VB 5, and ALL paint events are low priority. It worked
>in VB 4 just because VB 4 was designed to run slower, and paint
>images completely before proceeding to the next line of code.

thanks for the help guys... I just added the DoEvents function and
everything worked fine... I was puzzled as to why VB4 worked but VB5
didn't... Now I understand why.. thanks again!

jesse



Thu, 05 Oct 2000 03:00:00 GMT  
 this makes NO SENSE! help...


schreibt:

Quote:
>if vbkeyreturn then

What do you expect to happen here???

vbKeyReturn is a constant, and all VB versions up to VB4 treat any non-zero
values as True. But VB5 sometimes (yes, only sometimes!) decides that only a
value of -1 is regarded to be True. Consequently the above If is *always*
executed in VB4, but not always in VB5, and certainly always *independently*
from the actual key pressed :-(

BTW, it really doesn't make sense, your If statement ;-)

DoDi



Fri, 06 Oct 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. VBX makes sense, OCX makes sense - What is OCA?

2. making sense of access form design

3. Makes no sense! (I think)

4. Making sense out of binary data

5. Does it makes any sense? (Working with MSComm)

6. Making sense of AVI_COMPRESS_OPTIONS

7. Rediculous error makes no sense! Please help!

8. Help! This Makes No Sense!

9. Urgent help! This is not making any sense to me

10. Help Making a Help File

11. Help making Help Files!

12. Help making a help file

 

 
Powered by phpBB® Forum Software