Font Property issues.

vis781

Well-known member
Joined
Aug 30, 2005
Messages
2,016
Location
Cambridge, UK
Programming Experience
5-10
Font Property issues.[Resolved]

Hi all, and thanks for reading. I am having, most likely a simlple problem, with setting a font property in my custom control. I place a public property in my class with the name font however it tells me that this already exists in the base class, ok so i tried shadowing the property and even overriding it but, when i change the font at design time it's not peristed in my forms code. The only way i've found of doing this is the add another font property to my user control, but this means that there are two font properties there now, and it look a bit unprofessional. Can anyone help please?
 
Last edited:
Hey,

Don't quote me on this but I remember hearing a while back that you can put font in [] ie. [font] when you name it. Give it a go and post back I'd be interested to know if it works, not in a position where I can test it right now.

Edit: Scratch this its completely wrong!!
 
Last edited:
Hi, i've just had a look at a potential solution to this. Apparently i need to access the

[XMLIngore Class]

This i've been informed will allow me to show and hide the properties in the properties dialog window at design time.

Can anyone tell me if this is correct?
 
I haven't done a whole lot with this yet, so I could be wrong, but take a look at the PostFilterProperties method of the ComponentDesigner. That allows you to remove items from the properties window.
 
if the base class already has a font property then just use that

Label1.Font = Me.Font

that will call it's BaseClass font property and set Label1 to it
as an example
 
Back
Top