Making a form pop-up form a button 
Author Message
 Making a form pop-up form a button

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.*-*-*.com/ ).
Version: 6.0.435 / Virus Database: 244 - Release Date: 30/12/2002



Sat, 25 Jun 2005 18:55:14 GMT  
 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



Sun, 26 Jun 2005 02:53:47 GMT  
 Making a form pop-up form a button
Tom,

Cool, just need one more line of code before the show method.

PopupForm.StartPosition = FormStartPosition.Manual
Cheers

Randy


Quote:
> 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



> > 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



Sun, 26 Jun 2005 12:08:26 GMT  
 Making a form pop-up form a button
Whoops! I set that property on my form, instead of in the code

Cheers Randy

==============================================
Tom Spink

http://dotnetx.betasafe.com >> VB, VB.NET, C#, C++ Code


Quote:
> Tom,

> Cool, just need one more line of code before the show method.

> PopupForm.StartPosition = FormStartPosition.Manual
> Cheers

> Randy



> > 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



> > > 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



Sun, 26 Jun 2005 23:09:40 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Making a form a child form of an MDI form

2. Making a form a child form of an MDI form

3. Making a browse button in a form.

4. code that makes button move around form

5. making a button on form in runtime

6. Record select in popup form to populate parent form

7. Making a WinForm Pop-Up from a button

8. Which form called the popup form?

9. visible=true/Form.Show makes Form.Location change!

10. Making a Form the Active Form

11. making a mdi form a form during run time with click event

12. Making a child form much bigger than the parent MDI form

 

 
Powered by phpBB® Forum Software