Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

vb.net forms transition

Posted on 2013-11-23
3
Medium Priority
?
1,025 Views
Last Modified: 2013-11-24
I've the following situation: I'm developing a kiosk app (you know, without keyboard, only touch screen) where form1 calls form2, and this one call form3, etc,etc.

Those forms have the same background image (1500x1121, 150x150dpi,24 bits) streched to a 1280x1024 form size and most of them loads at least 2 images as buttons and one extra image as information text.

The code i'm using to call from one form to another is the following:

        Dim frmSCR001 As New SCR001
        frmSCR001.Show()
        Me.Dispose(False)

The fact is that the next screen flashes when is loaded. Is possible make that transition between forms more smoothly?

In VB6 I really don't remember this situation.

Tks in advance,
Leonel Rocha
0
Comment
Question by:leorocha
3 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 39672093
Try something like this out.  You start the Opacity() out at 0 (zero) and then sweep it up to 1 (one):
Public Class Form1

	Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
		Dim f2 As New Form2
		f2.Opacity = 0
		f2.StartPosition = FormStartPosition.Manual
		f2.Size = Me.Size
		f2.Location = Me.Location
		f2.Show()
		For i As Integer = 5 To 100 Step 5
			f2.Opacity = CDbl(i) / CDbl(100)
			Application.DoEvents()
			System.Threading.Thread.Sleep(100)
		Next
	End Sub

End Class

Open in new window

0
 
LVL 40
ID: 39672329
Usually, a form does not show until after its Load event terminates. But it can be forced to show before that point with a Show method or by setting its Visible property to True in the Load event code. When you do that, the form appears sooner, but might not be completely built, which might cause flashing.
0
 

Author Closing Comment

by:leorocha
ID: 39672336
It's  working, thanks!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question