fguihen Posted December 24, 2005 Posted December 24, 2005 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? Quote
Leaders snarfblam Posted December 24, 2005 Leaders Posted December 24, 2005 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); } Quote [sIGPIC]e[/sIGPIC]
fguihen Posted December 25, 2005 Author Posted December 25, 2005 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 Quote
Leaders snarfblam Posted December 25, 2005 Leaders Posted December 25, 2005 Then you might want to consider simply adding a panel and setting its visible property to true/false to show/hide it. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.