AppStudio 5 lets you use visual effects on controls and forms. The new functions are:
- fadeIn(msecs): Fades a form or control in. msecs is milliseconds to take for the effect. A value of 2000 would be 2 seconds. The default is 500. It is the same as doing a ctrl.show() function or ctrl.style.display = “block”, with, but the visual effect.
- fadeOut(msecs): Fades a form or control out. It is the same as doing a ctrl.hide() function or ctrl.style.display = “none”, but with the visual effect.
- slideDown(msecs): Displays a form or control as if it slid down from the top. It is the same as showing, but with the visual effect.
- slideUp(msecs): Hides a form or control as if it slid up to the top. It is the same as hiding, but with the visual effect.
These effects will work on all controls: buttons, textboxes, containers, grids, etc.
Image1.fadeIn(1000) 'Take one second to fade an image in Image1.slideUp() 'Hide the image by sliding it up MessageForm.fadeIn(2000) 'Display a form called MessageForm over the current one.
You can also use visual effects with the ChangeForm command. It has some new parameters:
ChangeForm(newForm[, hideEffect[, showEffect[, msecs]]])
If you just have the first parameter, ChangeForm will work as it always has. The current form will be hidden and the newForm will be displayed. hideEffect and showEffect can be “fade”, “slide” or “hide”. If you only supply only one effect (which looks best) the same effect will be used for hiding the old form and showing the new one. The last parameter is the time to take performing the effect.
Fade the current form out and fade in Form2:
Slide Form2 in. Take 1 second to fade out, 1 second to fade Form2 in:
ChangeForm(Form2, "slide", 1000)
Hide Form1, then take 1 second to fade in Form2:
ChangeForm(Form2, "hide", "slide", 1000)
Use ChangeForm instead of Form1.fadeOut() and Form2.fadeIn(). It’s easier, and your form’s close and open functions will be called.