This is a migrated thread and some comments may be shown as answers.

Form titlebar Icon

2 Answers 121 Views
TitleBar
This is a migrated thread and some comments may be shown as answers.
Nikk grey
Top achievements
Rank 1
Nikk grey asked on 01 Dec 2009, 07:32 AM

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 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 02 Dec 2009, 03:40 PM
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.
0
Nikk grey
Top achievements
Rank 1
answered on 03 Dec 2009, 05:19 AM
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!!!
Tags
TitleBar
Asked by
Nikk grey
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Nikk grey
Top achievements
Rank 1
Share this question
or