Solved

vb.net forms transition

Posted on 2013-11-23
3
860 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 85

Accepted Solution

by:
Mike Tomlinson earned 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now