
Making a form pop-up form a button
Try This:
Private Sub PopupForm(ByVal PopupForm As Form, ByVal SourceObject As
Control)
Dim pStart As New Point(SourceObject.Left, SourceObject.Top +
SourceObject.Height)
Dim pLoc As Point = Me.PointToScreen(pStart)
PopupForm.Left = pLoc.X
PopupForm.Top = pLoc.Y
Dim intOrigHeight As Integer = PopupForm.Height
Dim I As Integer
PopupForm.Height = 0
PopupForm.Opacity = 0
PopupForm.Show()
PopupForm.Refresh()
For I = 0 To intOrigHeight Step 5
PopupForm.Opacity = (I / intOrigHeight)
PopupForm.Height = I
System.Threading.Thread.Sleep(1)
Next I
PopupForm.Height = intOrigHeight
PopupForm.Opacity = 1.0F
End Sub
This will also fade the form, if you've Windows 2000+. If you want to leave
out the fading, remove any references to PopupForm.Opacity.
When you want to show the form, call this procedure with your form and the
source button.
==============================================
Happy To Help,
Tom Spink
http://dotnetx.betasafe.com >> VB, VB.NET, C#, C++ Code
Quote:
> Hi,
> I would like to make a form pop-up from a button, so that it slides out of
> it.
> Is that possible?
> Thnx.
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.435 / Virus Database: 244 - Release Date: 30/12/2002