CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2010
    Posts
    13

    Smile How to give a new control scrollbars

    I would like to create a new control, similar to the datagrid.

    From what I have read, to give it scrollbars it needs to inherite from ScrollableControl

    However, I also want to inherate from UserControl, and cSharp will not allow you to inherite from multiple base classes

    public partial class MyControl : UserControl, ScrollableControl

    Error 1 Class 'MyApplication.MyControl' cannot have multiple base classes: 'System.Windows.Forms.UserControl' and 'ScrollableControl'

    Any ideas on how I can go about this?

    Thanks

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: How to give a new control scrollbars

    A UserControl is a collection of controls. Create your control that derives from ScrollableControl and then add it to a UserControl.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured