Theme Picker

8 posts, 0 answers
  1. daivdhog
    daivdhog avatar
    4 posts
    Member since:
    Apr 2007

    Posted 10 May 2008 Link to this post

        I was trying to figure out how you did the theme picker in the "RadControls for WinForms Examples". I can't even figure out how you did the splash screen and the main form. When I look up the "Theme" sample for a control like grid view the dropdown button isn't pressent on the form. I tried searching the solution for just about everything I could think of to find the code for this.
    Could you point me in the right direction?
  2. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 12 May 2008 Link to this post

    Hello daivdhog,

    Thank you for contacting us.

    The splash screen in the QSF uses the SplashForm component. The following code snippet describes a typical usage of this component:

    Telerik.WinControls.UI.SplashForm splashForm = new Telerik.WinControls.UI.SplashForm(); 
    splashForm.BackgroundImage = Resources.splash; 
    splashForm.Show();  
    // ... 
    splashForm.Hide(); 

    The main form in the QSF inherits the ShapedForm class and uses a themed RadTitleBar component. The form's shape is set to a RoundRectShape through the Shape property of the ShapedForm.

    The Q1 2008 released introduced a new RadForm control. Take a look at the examples for RadForm in the QSF.

    The theme picker is a drop down button, filled with the available theme names for a specific control. You can get this list by using the GetAvailableThemes method of the ThemeResolutionService. Consider the following code snippet:

    ThemeList themes = ThemeResolutionService.GetAvailableThemes(radControl); 
    foreach (Theme theme in themes) 
        RadMenuItem item = new RadMenuItem(theme.ThemeName); 
        radDropDownButton1.Items.Add(item); 

    I hope this helps. Let me know, if you have other questions.

    Regards,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Juanps
    Juanps avatar
    2 posts
    Member since:
    May 2008

    Posted 28 May 2008 Link to this post

    Hello Jack, thanks for your help.
    What i'm trying to create is and SplashScreen that depending of the status will change the message on the lables, if he succesfully stablish the connection, or can connect to the DB, the the Label on the SplashScreen will change.

    Do you have some example, source code,  or  documents that might help?

    Thanks a lot



  5. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 29 May 2008 Link to this post

    Hi Juanps,

    Thank you for getting back to me.

    The SplashForm is a layered window. This allows the SplashForm to be semi-transparent, and because of this, it cannot contain labels or any other controls, unless you paint them manually.

    To display text in the SplashForm use the following method:

    void SetSplashText(SplashForm splashForm, Bitmap image, string message) 
        using (Graphics g = Graphics.FromImage(image)) 
        { 
            g.DrawString(message, SystemFonts.DialogFont, Brushes.Red, 10, 10); 
        } 
     
        splashForm.BackgroundImage = image; 
        MethodInfo method = typeof(SplashForm).GetMethod("UpdateLayeredWindow", BindingFlags.NonPublic | BindingFlags.Instance); 
        method.Invoke(splashForm, new object[] { (byte)255 }); 
     
    SplashForm splashForm = new SplashForm(); 
    splashForm.BackgroundImage = Resources.splashScreenImage; 
    splashForm.Show(); 
             
    // ... 
     
    SetSplashText(splashForm, Resources.splashScreenImage, "Hello world!"); 
     

    In future releases, we plan to implement the SplashForm as a RadControl. This will enable placing any RadElement inside the form.

    I hope this helps. Do not hesitate to contact me again, if you need further assistance.

    Best wishes,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Majid
    Majid avatar
    5 posts
    Member since:
    Jun 2011

    Posted 21 Apr 2012 Link to this post

    Hi,
    I am using Telerik WinForms Q1 2012. I want to use .gif file as background Image for SplashForm. 
    Is it possible?! how?

    Thanks
  7. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 23 Apr 2012 Link to this post

    Hi Majid,

    We recommend using Png files for the background of ShapedForm. This way you will be able to set transparency. However, you can set a Gif image by adding it in your resources. Access the file the same way as demonstrated in my previous post:
    SplashForm splashForm = new SplashForm();
    splashForm.BackgroundImage = Resources.splashScreenImage;
    splashForm.Show();

    I hope this helps. If you have further questions, do not hesitate to write back.

    Regards,
    Jack
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  8. Majid
    Majid avatar
    5 posts
    Member since:
    Jun 2011

    Posted 23 Apr 2012 Link to this post

    Hi Jack,
    Thanks for reply

    I followed you solution, and added my .gif file in resources.
    but unfortunately, It doesn't work. I just have a white box instead of my image. 



  9. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 24 Apr 2012 Link to this post

    Hi Majid,

    In this case I will need to test and debug your application in order to locate the issue. Could you please open a support ticket and send me the code?

    I am looking forward to your reply.
     
    Greetings,
    Jack
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready