Set treeview scrollbars theme to default windows based?

9 posts, 0 answers
  1. Hassan
    Hassan avatar
    15 posts
    Member since:
    Jan 2009

    Posted 17 Jan 2009 Link to this post

    Hi,

    I am using a RadTreeView and a webbrowser (System.Windows.Forms.Webbrowser) on a form, the problem is that i need to set the themes of both control's scrollbars similar. Is there any way to set the treeview's scrollbars theme to system theme (which windows is currently using). And what is the probability of you to add a web browser control in Telerik suite.  

    Thanks and regards

    Hassan
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 19 Jan 2009 Link to this post

    Hello Hassan,

    Thank you for writing.
    You can modify the appearance of the scrollbar to your liking by creating a custom theme that modifies only the scrollbars with the Visual Style Builder tool. Here are two links to the VSB documentation and video tutorials respectively:
    http://www.telerik.com/help/winforms/vsb_overview.html
    http://tv.telerik.com/home
    On the second link, click on the WinForms tab and check out the VisualStyleBuilder related videos.
    Let us know if you need assistance with this task.

    As for the WebBrowser control, we will not be including one in our control suite at least for now. Nevertheless you can customize the scrollbars of the WebBrowser control by embedding custom CSS rules within the rendered HTML document. Please let us know if you are interested by the approach.

    I hope we have been helpful. Please write back if you have more questions.

    Greetings,
    Victor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Hassan
    Hassan avatar
    15 posts
    Member since:
    Jan 2009

    Posted 20 Jan 2009 Link to this post

    Hi,

    Thanks for your reply but can you provide more help regarding changing theme in VSB for treeview scrollbar

    Regards,

    Hassan
  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 21 Jan 2009 Link to this post

    Hi Hassan,

    Thanks for writing.

    There are few specific things that you need to do.

    Firstly you need to create a theme for the RadVScrollBar or RadHScrollBar depending on how you need to scroll. Load the RadHScrollBar or RadVScrollBar and change its appearance. An important thing to do is to give this new theme a name. You can do that by typing the name in the text box on the menu bar(upper right corner of Visual Style Builder). Please see the screenshot if you are unsure about that.

    Secondly you need to create a theme for the RadTreeView. You just need to save an existing theme with the same name as the RadScrollBar theme. For example, if you have named the RadScrollBar theme "ScrollTheme" you need to name the RadTreeView theme "ScrollTheme" too. This is really important - the names need to be the same.

    The third step consists of adding the newly created xml files to your project, setting their Copy to Output Directory property to Copy if newer, and finally adding these two lines of code before the InitializeComponent() method invocation in your Form constructor.

    ThemeResolutionService.RegisterThemeFromStorage(ThemeStorageType.File, "~\\TreeTheme.xml");  
    ThemeResolutionService.RegisterThemeFromStorage(ThemeStorageType.File, "~\\ScrollTheme.xml");

     

    Also do not forget to replace the file names for the second argument with your actual file names.

    I hope this proves helpful and encourage you to write again if you have other questions.

    Kind regards,
    Victor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Hassan
    Hassan avatar
    15 posts
    Member since:
    Jan 2009

    Posted 21 Jan 2009 Link to this post

    Hi,

    I really appreciate your answer and i am going to try it, currently I have a question related to the same thread that is:

    I have an idea of using RadScroolbar with web browser control, i have tried but unsuccessful. Can you please help me on this regard as from this way I can achieve the same functionality.

    Thanks and regards,

    Hassan
  7. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 21 Jan 2009 Link to this post

    Hi Hassan,

    Thanks for your question.

    I have found a solution but I am afraid that only some sites can be scrolled and that flickering occurs because there is no sensible way to get the height of the currently displayed page.

    I have attached a sample application demonstrating what I mean. This is the best I could do and I would not recommend this approach because of the flickering and the failure to scroll on some sites.

    I hope this can at least give you a starting point to do further research. I think that the WebBrowser control was not designed to work with a custom scroll bar.

    Please write again if you have other issues or questions.

    Best wishes,
    Victor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. Haroon
    Haroon avatar
    38 posts
    Member since:
    Dec 2007

    Posted 28 Jan 2009 Link to this post

    Salam! i have tried the method u have suggested for theming scroll bars. Although it works well at design time and specified theme has been loaded and applied to Tree view scroll bar however it is not being applied at runtime. That is, whenever u run the project the scroll bar of tree view is loaded with default theme instead of one specified by me. Kindly guide me in this regard.

    Regards,
    Haroon
  9. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 30 Jan 2009 Link to this post

    Hi Haroon,

    It seems that the theme is not available at run time. Please take a look at the following resources:

    The possible ways of adding custom themes to your project are given in this article:
    http://www.telerik.com/support/kb/article/b454K-mmh-b454T-ckd-b454c-ckd.aspx
     
    For additional information on making themes you can read this forum thread:
    http://www.telerik.com/community/forums/thread/b311D-gdcka.aspx

    Do not hesitate to write me back if you have more questions.

    Regards,
    Jordan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 22 Mar 2011 Link to this post

    Hello guys,

    Please note that in Q1 2011 we have introduced a major upgrade of RadTreeView control, which is now virtualized and fully customizable. Feel free to download the latest release and try it out. For more information on our latest release refer to this blog post.

    Best wishes,
    Stefan
    the Telerik team
Back to Top
UI for WinForms is Visual Studio 2017 Ready