Author |
Message |
Magi #1 / 5
|
 Cool Screen Wipes???
Hi Guys, I downloaded the following code but it doesn't seem to work. it needs variables in the Command button event. I tried Integer, String, Single and Long. None would work. If anybody would care to give it a go and report back, I'd be interested in what was found. Also, I not clear as to the meaning of the "!" and "%" after variables. How and why are they used? Are there any more symbols like these that are used with variables? Thanks, Magic '**************************************************************** ' Name: Cool screen wipes ' Description:You can achieve some cool form wipes with judi ' cious use of the Move method. For example, to draw a curtain ' from right to left use this routine. It is also possible to ' wipe a form from bottom to top, and from both sides to the ' middle, using similar routines ' By: VB Pro ' ' Inputs:None ' Returns:None ' Assumes:None ' Side Effects:None ' 'Code provided by Planet Source Code(tm) 'as is', without ' warranties as to performance, fitness, merchantability, ' and any other warranty (whether expressed or implied). '**************************************************************** Sub WipeRight (Lt%, Tp%, frm As Form) Dim s, Wx, Hx, i s = 90 'number of steps to use in the wipe Wx = frm.Width / s 'size of vertical steps Hx = frm.Height / s 'size of horizontal steps ' ' top and left are static ' ' while the width gradually shrinks For i = 1 To s - 1 frm.Move Lt, Tp, frm.Width - Wx Next End Sub 'Call the routine from a command button by using this code: L = Me.Left T = Me.Top WipeRight L, T, Me
|
Mon, 11 Dec 2000 03:00:00 GMT |
|
 |
Lab #2 / 5
|
 Cool Screen Wipes???
Quote:
> Hi Guys, > I downloaded the following code but it doesn't seem to work. > it needs variables in the Command button event. I tried Integer, > String, > Single and Long. None would work. If anybody would care to give it > a go and report back, I'd be interested in what was found. > Also, I not clear as to the meaning of the "!" and "%" after variables. > How and why are they used? Are there any more symbols like these > that are used with variables? > Thanks, > Magic > '**************************************************************** > ' Name: Cool screen wipes > ' Description:You can achieve some cool form wipes with judi > ' cious use of the Move method. For example, to draw a curtain > ' from right to left use this routine. It is also possible to > ' wipe a form from bottom to top, and from both sides to the > ' middle, using similar routines > ' By: VB Pro > ' > ' Inputs:None > ' Returns:None > ' Assumes:None > ' Side Effects:None > ' > 'Code provided by Planet Source Code(tm) 'as is', without > ' warranties as to performance, fitness, merchantability, > ' and any other warranty (whether expressed or implied). > '**************************************************************** > Sub WipeRight (Lt%, Tp%, frm As Form) > Dim s, Wx, Hx, i > s = 90 'number of steps to use in the wipe > Wx = frm.Width / s 'size of vertical steps > Hx = frm.Height / s 'size of horizontal steps > ' ' top and left are static > ' ' while the width gradually shrinks > For i = 1 To s - 1 > frm.Move Lt, Tp, frm.Width - Wx > Next > End Sub > 'Call the routine from a command button by using this code: > L = Me.Left > T = Me.Top > WipeRight L, T, Me
This works. You just have to declare your variables as the correct type. The % means integer so in the command button code do: dim L% dim T% before anything else. The ! is a bang but I don't see where it appears in this code. Look in the help file these operators are right at the beginning. Boden Larson SGM Biotech, Inc. sgmbio AT imt DOT net
|
Mon, 11 Dec 2000 03:00:00 GMT |
|
 |
Magi #3 / 5
|
 Cool Screen Wipes???
Quote:
> This works. You just have to declare your variables as the correct > type. The % means integer so in the command button code do: > dim L% > dim T% > before anything else. The ! is a bang but I don't see where it appears > in this code. Look in the help file these operators are right at the > beginning. > Boden Larson > SGM Biotech, Inc. > sgmbio AT imt DOT net
Thanks for you help Boden, Magic
|
Tue, 12 Dec 2000 03:00:00 GMT |
|
 |
Bill Le #4 / 5
|
 Cool Screen Wipes???
Hi, just a beginner with VB, but from the class I took......% is a variable suffix for integer (replaces "LT as integer"). You'll have to dim L and T as integer for the command button, and your form looks like it'll have to be named Me.frm. Is this right, any of the many MUCH more knowledgeable gurus out there? Quote:
> Hi Guys, > I downloaded the following code but it doesn't seem to work. > it needs variables in the Command button event. I tried Integer, > String, > Single and Long. None would work. If anybody would care to give it > a go and report back, I'd be interested in what was found. > Also, I not clear as to the meaning of the "!" and "%" after variables. > How and why are they used? Are there any more symbols like these > that are used with variables? > Thanks, > Magic > '**************************************************************** > ' Name: Cool screen wipes > ' Description:You can achieve some cool form wipes with judi > ' cious use of the Move method. For example, to draw a curtain > ' from right to left use this routine. It is also possible to > ' wipe a form from bottom to top, and from both sides to the > ' middle, using similar routines > ' By: VB Pro > ' > ' Inputs:None > ' Returns:None > ' Assumes:None > ' Side Effects:None > ' > 'Code provided by Planet Source Code(tm) 'as is', without > ' warranties as to performance, fitness, merchantability, > ' and any other warranty (whether expressed or implied). > '**************************************************************** > Sub WipeRight (Lt%, Tp%, frm As Form) > Dim s, Wx, Hx, i > s = 90 'number of steps to use in the wipe > Wx = frm.Width / s 'size of vertical steps > Hx = frm.Height / s 'size of horizontal steps > ' ' top and left are static > ' ' while the width gradually shrinks > For i = 1 To s - 1 > frm.Move Lt, Tp, frm.Width - Wx > Next > End Sub > 'Call the routine from a command button by using this code: > L = Me.Left > T = Me.Top > WipeRight L, T, Me
|
Tue, 12 Dec 2000 03:00:00 GMT |
|
 |
Robert Gin #5 / 5
|
 Cool Screen Wipes???
On Fri, 26 Jun 1998 12:42:00 -0400, Bill Lee Quote:
>Hi, just a beginner with VB, but from the class I took......% is a >variable suffix for integer (replaces "LT as integer"). You'll have to >dim L and T as integer for the command button, and your form looks like >it'll have to be named Me.frm. Is this right, any of the many MUCH more >knowledgeable gurus out there?
[Snip] The Me variable always refers to the instance of the object (Form, Class, or Module) in which it appears. Use it when you want the object to call methods within itself when there are potential scope problems. The most common use of 'Me' that I've run across is when the form needs to Show or Hide itself, and can't be sure it's the active form. The Show/Hide methods work on the active (the one with focus) form by default, if your form isn't modal, and it isn't the only form in your project, you can't guarantee that it's the active form. To get by this feature <g> use the Me operator before the Show/Hide. Me.Show explicitly calls the Show method of the form it appears in. Form1.Show would work if you only have one instance of the form, and it happened to be named Form1. However, VB will allow you to create a new instance of Form1 with the statement: Dim MyNewForm1 as new Form1. And if the Form1.Show code is called from the MyNewForm1 instance, the wrong instance will appear, and chaos will surely follow. HTH Ginda.
|
Fri, 15 Dec 2000 03:00:00 GMT |
|
|
|