Solved

vb.net forms transition

Posted on 2013-11-23
3
952 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 86

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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…

710 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