|
-
Jan 24th, 2004, 06:17 AM
#1
Thread Starter
Fanatic Member
small to big forms
This is my aim: when a button is clicked, a form should should appear, but it should be really small and it should grow to a size of the screen, and then it should be slightly transparent (enough so u can read it but the form behind is visible).
How can i do this?
I know how to do the opacity bit. Thats no problem. Its making the screen grow from small to big.
-
Jan 24th, 2004, 07:45 AM
#2
Member
Something like this (using a Timer on the form).... ?
VB Code:
Imports System.Windows.Forms, System.Windows.Forms.SystemInformation
Public Class Form1
Inherits System.Windows.Forms.Form
Const nSteps As Integer = 50
Private stepX As Integer = WorkingArea.Width \ (nSteps - 1)
Private stepY As Integer = WorkingArea.Height \ (nSteps - 1)
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Static counter As Integer
If counter < nSteps Then
Width += stepX
Height += stepY
Me.CenterToScreen()
counter += 1
Else
counter = Nothing
Timer1.Enabled = False
WindowState = FormWindowState.Maximized
Opacity = 0.75
End If
End Sub
End Class
Needs some tweaking... but seems a bit slow for me, but with nSteps lower seems jerky. Prolly a better way of doing it but that's my 2 minute answer!
-
Jan 24th, 2004, 08:56 AM
#3
Thread Starter
Fanatic Member
Thats fine for me. I set the nsteps to 25 and its looks pretty good.
I have a problem though. The components within the form stay at the same size. How can i make these grow aswell relevant to the screen size and my original size?
I was thinking of just adding the components on after wards. Which would be teh best way of doing it: adding the components on afterwards or having the components grow?
I tried a couple of things to make the components grow but it crashes.
-
Jan 24th, 2004, 10:00 AM
#4
Member
Add everything on afterwards!
Trying to make all the controls on the form grow as well would require a lot of coding and probably slow things up quite badly.
Clever use of panels and the dock & anchor properties may get you somewhere near the desired effect - but its a lot off effort for something that is unkiley to look that good.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|