Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
i want to be able to click a button on a form, which will make a piece slide out of or appear at the side of the form, which i can close again without closing the form. the piece that slides out/appears is to contain more controls. is this possible?
  • Leaders
Posted

Quite possible.

   'Constants to specify animation type and direction
   Enum AnimationConstants As Integer
       AW_HOR_POSITIVE = 1
       AW_HOR_NEGATIVE = 2
       AW_VER_POSITIVE = 4
       AW_VER_NEGATIVE = 8
       AW_CENTER = 16
       AW_HIDE = 65536
       AW_ACTIVATE = 131072
       AW_SLIDE = 262144
       AW_BLEND = 524288
   End Enum

   'Import from Windows API
   <System.Runtime.InteropServices.DllImport("user32.dll")> _
   Shared Function AnimateWindow( _
       ByVal hWnd As IntPtr, _
       ByVal millseconds As Integer, _
       ByVal lFlags As AnimationConstants) As Boolean
   End Function

   Sub Example()
       AnimateWindow(Me.Handle, 300, AnimationConstants.AW_VER_NEGATIVE)
   End Sub

	enum AnimationConstants{
	AW_HOR_POSITIVE = 1,
	AW_HOR_NEGATIVE = 2, 
	AW_VER_POSITIVE = 4 ,
	AW_VER_NEGATIVE = 8,
	AW_CENTER = 16,
	AW_HIDE = 65536,
	AW_ACTIVATE = 131072,
	AW_SLIDE = 262144,
	AW_BLEND = 524288
}

[system.Runtime.InteropServices.DllImport("user32.dll")]
bool AnimateWindow(IntPtr hWnd, int millseconds, AnimationConstants Flags );

	void Example(){
		AnimateWindow(this.Handle, 300, AnimationConstants.AW_VER_NEGATIVE);
	}

[sIGPIC]e[/sIGPIC]
Posted
thank you, however your answer is a bit more complex than i require. i want to know how do i make a form appear at the side of an existing form, to show controls that are hidden when this piece of form is not visible. animation is not important, just as long as i can make the piece of the form appear and disappear on request is more important

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...