Solved

vb.net forms transition

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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 tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

635 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