How to creat a non rectangular form

Q

QuocSI

Hi every body!

I wish to creat a non rectangular form.
Can you help me please.

Thanks a lot.
 
L

Lloyd Sheen

I just tried this and if this is supposed to work then the simple
instructions are incorrect. All I get is a form with the background as
painted.

Very nice MS. A really great article. A dismal result.

Lloyd Sheen
 
T

Tim Wilson

If you used the bitmap background method then there is a known issue that
was explained in the article:
" Note Monitors set to a color depth of greater than 24-bit can display
problems with certain parts of the form not being transparent, despite
setting of the TransparencyKey property. To avoid this problem, ensure that
the monitor's color depth is set to less than 24-bit in the Display control
panel. When developing applications that feature this transparency, keep in
mind that you will have to make your users aware of this issue. "

The other method from the article should work fine - using the GraphicsPath
class to ultimitely build a custom Region for the Form (or control).
 
L

Lloyd Sheen

That was it. Now would it not be good if they would fix this. I will try
the GraphicsPath to get past this.
Thanks
Lloyd Sheen
 
L

Lloyd Sheen

PS to my thanks. The form does not have a region property that I can see.
Only controls have. So all the rest of the article is not germain to the
discusssion.

As far as I can see using a region cannot be applied to forms.

Lloyd Sheen
 
T

Tim Wilson

A Form is a Control. Region is a property on the Control class and
System.Windows.Forms.Form indirectly derives from Control. So Region is
actually a property that can be accessed against a Form object, but it will
not appear in the designer. You must assign it in code.
 
L

Lloyd Sheen

Thanks , that did it. Just a question, why would anyone create a member of
a class that is hidden as far as Object Browser / Intellisense?

Lloyd Sheen
 
T

Tim Wilson

Sometimes it's not logical to have a property exposed either in the designer
or through intellisense. For example, the "Text" property that is inherited
from the base Control class is not really relevant to the PictureBox. So
it's hidden from the developer to show that it really serves no purpose to
that particular derived control. However, you can still use the property as
it does exist. It's just not viewed as a meaningful property. And yet some
properties, the Region property for example, are just not worth exposing in
the designer as they're not commonly used or would require additional
overhead of having to do custom type conversion or creating a UI type editor
to allow the developer to create and manipulate them at design-time.
 
L

Lloyd Sheen

Thanks for the explanation. I will keep that in mind while designing classes
although for starters we will keep all properties/methods visible.

Lloyd Sheen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top