Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fading

Status
Not open for further replies.

saintedmunds

Technical User
Apr 7, 2006
78
GB
Hi

Im just putting together a Sales display and have 4 forms lets call them form1 form2 form3 and main in the main form I have a panel with a timer after 30 seconds it display the next form etc is there any way of getting the forms to fade in and out of the panel? or even to move a form from left to right over the over the other form?

Thank you
 
Yes.

the forms have an opacity setting, use that or set startposition to manual and move the form to where you want.


Christiaan Baes
Belgium

My Blog
 
use a timer and in the tick event do form1.left +=1 this will move it left


Christiaan Baes
Belgium

My Blog
 
Ok understand that
How do i stop it when its in the right place?
something like when x = 0??

Cheers
 
This is not a guessing game show me some code and then I can tell what you are doing wrong.

Christiaan Baes
Belgium

My Blog
 
Sorry here you go.
Main Form with panel:
Public Class fMain

Dim myfrm As Form
Private Sub fMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


myfrm = My.Forms.fAvailable

Me.cMainPanel.Controls.Clear()
myfrm.TopLevel = False
myfrm.Dock = DockStyle.Fill

Me.cMainPanel.Controls.Add(myfrm)
myfrm.Show()

End Sub

Private Sub cTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles cTimer.Tick
Call fnDisplayNextForm()
End Sub

Sub fnDisplayNextForm()

If My.Forms.fAvailable.Visible Then
myfrm = My.Forms.fHold
My.Forms.fAvailable.Visible = False
ElseIf My.Forms.fHold.Visible Then
myfrm = My.Forms.fSalesDetails
My.Forms.fHold.Visible = False
Else
myfrm = My.Forms.fAvailable
My.Forms.fSalesDetails.Visible = False
End If

Me.cMainPanel.Controls.Clear()
myfrm.TopLevel = False
myfrm.Dock = DockStyle.Fill

Me.cMainPanel.Controls.Add(myfrm)
myfrm.Show()
End Sub
End Class

One of the forms i open fSalesDetails:

Public Class fSalesDetails



Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim frm As Form
frm = Me

frm.Left += 1
End Sub
End Class

Cheers
 
And where are you telling it to start and stop the timer in the fsalesdetails form? where are you telling it to start from?


and the dim frm as form is completely unnecessary.

Christiaan Baes
Belgium

My Blog
 
Hi

I have the timer set to enabled so when the form opens its already started.

And the on the main form timer in closes this foem when it opens the next one so i didnt think i would need to stop it?

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top