Oct 30, 2012 02:14 PM
(This post was last modified: Oct 30, 2012 02:15 PM by BlackCap.)
After a request by MadGod I created this tutorial on my PageControl. You can find the source of the project in the original thread.
Spoiler (Click to View)
So lets get right to it :)
Open visual studio and create a new Windows Form Application. Right-click on your project in the solution explorer and chose "Open Folder In File Explorer". Open another folder browser and browse to the source of my PageControl project. Copy the "PageControl" folder and paste it in your own project folder.
Screenshot:
Spoiler (Click to View)
Press the "Show All Files" button in the upper right corner of the solution explorer window. Right-click the "PageControl" folder and chose "Include In Project".
Screenshot:
Spoiler (Click to View)
Right-click your project in the solution explorer and chose "Add Referance" and add System.Design.
Screenshot:
Spoiler (Click to View)
Create a new class, name it whatever and inherit from the PageControl:
Build your project and double-click the class you just created in the solution explorer.
Screenshot:
Spoiler (Click to View)
This is your designer, which is where you add your pages. We don't have any pages yet, so lets create some.
Create a new UserControl, name it whatever and design a page of your choice. This is my page:
Screenshot:
Spoiler (Click to View)
Browse to the designer code of your new page and change "Inherits System.Windows.Forms.UserControl" to "Inherits PageControl.Page".
Screenshot:
Spoiler (Click to View)
Build your project and head back to the page designer. The page you just created is now in your toolbox. Double-click it to add it to the designer and place it whereever you want. Add a couple more while your at it and place them at random locations in the table.
Screenshot:
Spoiler (Click to View)
You'll notice that the pages have different numbers in the bottom right corner. This indicates the index of the pages, which means that the one with 1 will be the first page, the one with 2 the secound and so on.
Their position on the grid is where they're placed in the control and they will animate thereafter.
You can find the PageControl in the toolbox in the form designer.
Screenshot:
Spoiler (Click to View)
You can navigate across the pages with the "PageControl.GoToPage" method.
Because I'm lazy I have included the gif from the previus thread which displays the animation:
Spoiler (Click to View)
So lets get right to it :)
Open visual studio and create a new Windows Form Application. Right-click on your project in the solution explorer and chose "Open Folder In File Explorer". Open another folder browser and browse to the source of my PageControl project. Copy the "PageControl" folder and paste it in your own project folder.
Screenshot:
Spoiler (Click to View)
Press the "Show All Files" button in the upper right corner of the solution explorer window. Right-click the "PageControl" folder and chose "Include In Project".
Screenshot:
Spoiler (Click to View)
Right-click your project in the solution explorer and chose "Add Referance" and add System.Design.
Screenshot:
Spoiler (Click to View)
Create a new class, name it whatever and inherit from the PageControl:
Code
Public Class MyPages
Inherits PageControl
End ClassBuild your project and double-click the class you just created in the solution explorer.
Screenshot:
Spoiler (Click to View)
This is your designer, which is where you add your pages. We don't have any pages yet, so lets create some.
Create a new UserControl, name it whatever and design a page of your choice. This is my page:
Screenshot:
Spoiler (Click to View)
Browse to the designer code of your new page and change "Inherits System.Windows.Forms.UserControl" to "Inherits PageControl.Page".
Screenshot:
Spoiler (Click to View)
Build your project and head back to the page designer. The page you just created is now in your toolbox. Double-click it to add it to the designer and place it whereever you want. Add a couple more while your at it and place them at random locations in the table.
Screenshot:
Spoiler (Click to View)
You'll notice that the pages have different numbers in the bottom right corner. This indicates the index of the pages, which means that the one with 1 will be the first page, the one with 2 the secound and so on.
Their position on the grid is where they're placed in the control and they will animate thereafter.
You can find the PageControl in the toolbox in the form designer.
Screenshot:
Spoiler (Click to View)
You can navigate across the pages with the "PageControl.GoToPage" method.
Because I'm lazy I have included the gif from the previus thread which displays the animation:


![[Image: 09.png]](https://dl.dropbox.com/u/69377299/PageTut/09.png)
![[Image: 01.png]](https://dl.dropbox.com/u/69377299/PageTut/01.png)
![[Image: 02.png]](https://dl.dropbox.com/u/69377299/PageTut/02.png)
![[Image: 03.png]](https://dl.dropbox.com/u/69377299/PageTut/03.png)
![[Image: 04.png]](https://dl.dropbox.com/u/69377299/PageTut/04.png)
![[Image: 05.png]](https://dl.dropbox.com/u/69377299/PageTut/05.png)
![[Image: 06.png]](https://dl.dropbox.com/u/69377299/PageTut/06.png)
![[Image: 07.png]](https://dl.dropbox.com/u/69377299/PageTut/07.png)
![[Image: 08.png]](https://dl.dropbox.com/u/69377299/PageTut/08.png)