Form titlebar Icon

3 posts, 0 answers
  1. Nikk grey
    Nikk grey avatar
    11 posts
    Member since:
    Sep 2009

    Posted 01 Dec 2009 Link to this post


    Hi,
    I wish to add an icon on the top of a form which should look like as if its half outside the boundaries of the form, like you guys have implemented in your demos form, (pic attached and region highlighted).
    Secondly can i add a .gif rather than an .ico as in a standard windows form. So that some kind of animation is possible?
    Thank you!!!
  2. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 02 Dec 2009 Link to this post

    Hi Nikk,

    The way you can achieve the effect seen in our Demo Application is by using a region with the desired shape and apply it to a Form with a FormBorderStyle property set to None. You will also have to recalculate the region each time the form resizes. What is left is to position the images you would like to see on your form in a way that they are not clipped by the region.

    The class which defines the shape of our demos application is Telerik.WinControls.QuickStart and it resides in QuickStart.dll assembly.

    You can use the following approach to define a region of your form with this shape:


    protected override void OnResize(EventArgs e)
    {
        base.OnResize(e);
      
        QsfShape shape = new QsfShape();
      
        GraphicsPath path = shape.CreatePath(new Rectangle(0, 0, this.Width, this.Height));
      
        this.Region = new Region(path);
          path.Dispose();
    }

    I hope this is helpful.

    Sincerely yours,
    Deyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Nikk grey
    Nikk grey avatar
    11 posts
    Member since:
    Sep 2009

    Posted 02 Dec 2009 Link to this post

    Hi,
    Thank you  for the solution...
    For once i know regions are used to assign customized shapes to windows forms.
    But it would be really helpful, if you can create me a demo application, a simple as possible one. 
    I needed to create an almost exact duplicate of the demos forms you guys have impressively created, as in the image attached. 
    + I needed to just show a .gif rather than a static image (.ico) as in title bar, which i wished to changed on my will to show some action has been performed etc. the rest of the layout would be same. so can you please cook  me up a demo app which does all these things.That would be really helpful.
    Thank you!!!
Back to Top