Ticket A1056
Visible to All Users

How to reorder the pages in the ExpressPageControl via drag-and-drop

created 21 years ago

Description:
I wish to allow an end-user to reorder the pages in the ExpressPageControl at runtime. How can I implement this?

Answer:
You should set the PageControl's DragMode property to the dmAutomatic value and handle the control's OnStartDrag, OnDragOver and OnDragDrop events. The first one is necessary to create a DragObject instance and save the Tab which is about to be dragged. The second event is necessary to prevent the end-user from dropping a tab onto itself. Finally, you need to handle the OnDragDrop event to reorder pages. This can be done if you set the Tab's PageIndex property value.
Attached you will find a sample project showing how this can be done.
See also:
How do I determine under which tab of a PageControl the mouse pointer is above

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.