Click here to Skip to main content
Click here to Skip to main content

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

Comments and Discussions

QuestionQuestion PinmemberMember 968818415-Jul-13 22:04 
GeneralMy vote of 5 Pinmemberragavaisr27-Apr-13 23:10 
Questionslide in the opposite direction PinmemberAbdul Rahman El Habboub7-Jan-13 0:26 
QuestionWhen lost focus PinmemberGlimmerMan19-Jun-11 3:06 
GeneralMy vote of 4 PinmemberGlimmerMan19-Jun-11 3:04 
QuestionHow to design the slide form Pinmemberrahul_raut17-May-11 23:32 
GeneralMy vote of 5 Pinmemberrahul_raut17-May-11 23:29 
GeneralSome aesthetic issues PinsussAnonymous15-Feb-05 15:10 
GeneralRe: Some aesthetic issues PinmemberCookie_Jar9-Jul-06 0:32 
GeneralRe: Some aesthetic issues Pinmemberkaymyst10-May-07 6:26 
GeneralOne problem!! PinmemberKaosu17-Jan-04 23:05 
GeneralRe: One problem!! Pinmembersnarfblam28-Dec-06 15:28 
GeneralA SliderWindow does not dock to an MDI child PinsussMamacita7-May-03 1:09 
GeneralMissed Solution File PinmemberJerry Maguire22-Dec-02 1:13 
GeneralRe: Missed Solution File Pinmembernimbus3d25-Dec-02 4:20 
GeneralRe: Missed Solution File PinmemberJerry Maguire25-Dec-02 6:07 
GeneralForm plane level Pinmemberjlwxsf19-Dec-02 14:44 
GeneralRe: Form plane level Pinmembernimbus3d25-Dec-02 4:18 
GeneralRe: Form plane level PinsussStefan Turalski5-Oct-04 2:27 
GeneralRe: Form plane level Pinmemberstefantura5-Oct-04 3:15 
GeneralChanging the rate PinmemberMarc Clifton19-Dec-02 9:27 
GeneralRe: Changing the rate PinmemberMyMojo20-Dec-02 19:54 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150327.1 | Last Updated 19 Dec 2002
Article Copyright 2002 by nimbus3d
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid