Click here to Skip to main content
13,299,495 members (68,418 online)
Click here to Skip to main content
Add your own
alternative version


103 bookmarked
Posted 18 Dec 2002

A slide form base

, 18 Dec 2002
Rate this:
Please Sign up or sign in to vote.
A slide form class from which to derive your forms from


Sometime ago, I needed a form that had a sliding panel on its side. I’ve checked the web to avoid coding. I’ve found a solution on I’ve used and improved the C++/MFC code. Since, I use C# for my development, you can find here the result of my work. The form class must be inherited and the specialized form must implement a special constructor. You can find below a small example.

Design of a simple slide form

Use the “Add inherited form” wizard in Visual Studio .NET, and select the SlideForm in the inheritance picker dialog.

You’ve got the following form in your project:

Resize and customize it with the appropriate controls. Keep in mind that this form will be hidden by the main form, so, ensure that the child form is smaller than the parent:

Next, you must provide a special constructor for this slide form. This constructor take a reference on the parent form and the step of sliding. This step is a percentage of the slide form that will be showed at each ticks of timer.

public MySlideForm(Form poOwner, float pfStep) : base(poOwner, pfStep) 

We are done with the sliding form. Now, have a look of the way we will make our slide form slide. First, instantiate the slide form:

// In parent form constructor for instance
oSlideForm = new MySlideForm(this, 0.1f); 
// ...

Next, in the handler of the button that command the sliding of the form, use the following code:

// ...
_oSlideForm.SlideDirection = SlideDialog.SlideDialog.SLIDE_DIRECTION.RIGHT; 
// ...

In this example, the form will slide by the right side of the parent form. That's all! Enjoy!


  • Initial posting - December 2002


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Software Developer (Senior)
France (Metropolitan) France (Metropolitan)
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionQuestion Pin
Member 968818415-Jul-13 22:04
memberMember 968818415-Jul-13 22:04 
GeneralMy vote of 5 Pin
ragavaisr27-Apr-13 23:10
memberragavaisr27-Apr-13 23:10 
Questionslide in the opposite direction Pin
Abdul Rahman El Habboub7-Jan-13 0:26
memberAbdul Rahman El Habboub7-Jan-13 0:26 
QuestionWhen lost focus Pin
GlimmerMan19-Jun-11 3:06
memberGlimmerMan19-Jun-11 3:06 
If the slider form is visible and the app loses focus then when reactivating the app with the slider the slider form will not show again. Any thoughts on how to fix this? Again thanks for sharing!
Kevin S. Gallagher
Programming is an art form that fights back

GeneralMy vote of 4 Pin
GlimmerMan19-Jun-11 3:04
memberGlimmerMan19-Jun-11 3:04 
QuestionHow to design the slide form Pin
rahul_raut17-May-11 23:32
memberrahul_raut17-May-11 23:32 
GeneralMy vote of 5 Pin
rahul_raut17-May-11 23:29
memberrahul_raut17-May-11 23:29 
GeneralSome aesthetic issues Pin
Anonymous15-Feb-05 15:10
sussAnonymous15-Feb-05 15:10 
GeneralRe: Some aesthetic issues Pin
Cookie_Jar9-Jul-06 0:32
memberCookie_Jar9-Jul-06 0:32 
GeneralRe: Some aesthetic issues Pin
kaymyst10-May-07 6:26
memberkaymyst10-May-07 6:26 
GeneralOne problem!! Pin
Kaosu17-Jan-04 23:05
memberKaosu17-Jan-04 23:05 
GeneralRe: One problem!! Pin
snarfblam28-Dec-06 15:28
membersnarfblam28-Dec-06 15:28 
GeneralA SliderWindow does not dock to an MDI child Pin
Mamacita7-May-03 1:09
sussMamacita7-May-03 1:09 
GeneralMissed Solution File Pin
Jerry Maguire22-Dec-02 1:13
memberJerry Maguire22-Dec-02 1:13 
GeneralRe: Missed Solution File Pin
nimbus3d25-Dec-02 4:20
membernimbus3d25-Dec-02 4:20 
GeneralRe: Missed Solution File Pin
Jerry Maguire25-Dec-02 6:07
memberJerry Maguire25-Dec-02 6:07 
GeneralForm plane level Pin
jlwxsf19-Dec-02 14:44
memberjlwxsf19-Dec-02 14:44 
GeneralRe: Form plane level Pin
nimbus3d25-Dec-02 4:18
membernimbus3d25-Dec-02 4:18 
GeneralRe: Form plane level Pin
Stefan Turalski5-Oct-04 2:27
sussStefan Turalski5-Oct-04 2:27 
GeneralRe: Form plane level Pin
stefantura5-Oct-04 3:15
memberstefantura5-Oct-04 3:15 
GeneralChanging the rate Pin
Marc Clifton19-Dec-02 9:27
memberMarc Clifton19-Dec-02 9:27 
GeneralRe: Changing the rate Pin
MyMojo20-Dec-02 19:54
memberMyMojo20-Dec-02 19:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171207.1 | Last Updated 19 Dec 2002
Article Copyright 2002 by nimbus3d
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid