RadColorSelector - used in VS IDE

4 posts, 0 answers
  1. Curtis
    Curtis avatar
    23 posts
    Member since:
    Oct 2014

    Posted 20 Jul Link to this post

    I'm a WinForms developer - have been for a very long time now.  Anyway, as much as I love Visual Studio the one thing that I truly dislike is their color-selector that drops down in the Properties window whenever you click on the ... button.  Ok for selecting System or Web colors its fine but lets face it - that custom color thing they haven't upgraded in YEARS is the worst.

    So, ages ago I built my own Color Selector that I use to replace that thing in the IDE but then I discovered Telerik controls a few years back and it hits me!  There's a VERY NICE color selector in these controls which does everything my ancient one did PLUS it includes Web and System colors.

     

    Here's my question (if you look at the screenshots I've included this will probably make more sense!)

    When I'm in VS's IDE and I'm editing a form or whatever in the Designer and I want to edit one of the colors AND that color is a "Known" color (either System or Web) I'd like to be able to tell the RadColorSelector which tab it should start on (I have ShowBasicColor = False btw)

     

    I'm also happy to give this code to anyone who is a subscriber to Telerik UI for WinForms if anyone would like this for their own use I just don't know if Telerik allows that and if they do, where to deposit the source code (it's really pretty easy once you know how its done.)  The only restriction is I happen to like the Windows8 Theme for my dialog boxes regardless of the Theme I'm using for the rest of the application - so that means you'll have to add the Windows8 Theme DLL to your project for this to just plug-in and work.  It would be stupid-easy to just pass in whatever theme you like but for some reason RadColorSelector doesn't play well with some themes....anyway I digress

     

    If it's possible to programmatically select the Tab in RadColorSelector I'd very much appreciate anyone showing me how!

    Thanks all :)

    -C

     

     

  2. Hristo
    Admin
    Hristo avatar
    1016 posts

    Posted 21 Jul Link to this post

    Hi Curtis,

    Thank you for writing.

    In order to edit colors, we are using our RadColorDialog control: http://docs.telerik.com/devtools/winforms/forms-and-dialogs/colordialog/colordialog.

    You can programmatically select a particular page by accessing the user control holding the RadPageView with the different tabs: 
    private void radButton1_Click(object sender, EventArgs e)
    {  
        RadColorSelector selector = ((RadColorDialogForm)this.radColorDialog1.ColorDialogForm).RadColorSelector as RadColorSelector;
        // 0 -> Basic tab
        // 1 -> System tab
        // 2 -> Web tab
        // 3 -> Professional tab
        selector.ControlsHolderPageView.SelectedPage = selector.ControlsHolderPageView.Pages[2];
     
        this.radColorDialog1.ShowDialog();
    }

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Curtis
    Curtis avatar
    23 posts
    Member since:
    Oct 2014

    Posted 21 Jul in reply to Hristo Link to this post

    It helps a LOT actually, thanks again Hristo!

    As for RadColorDialog, that's a Dialog Box one would use inside their executing application for situations when color selection would be required.  What I've built is used inside Visual Studio while in Designer mode (though the object itself is a dialog box and can be used independently I wouldn't...its just easier and wiser to use RadColorDialog :) )

    Anyway thank you!

    -C

  4. Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 24 Jul Link to this post

    Hi Curtis,

    You can share your project for this in our Code Library (include the project only without the assemblies). I am sure that it would be interesting to our users to know how to use our controls inside Visual Studio. In addition, you will get some Telerik Points.

    Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top