468,512 Members | 1,405 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

propertygrid utilization

How can I set the browsableattributes of the control that has been selected
(selectedobject) by the propertygrid?

Here's what I'm after - I want to open a form with a propertygrid in it.
The selectedobject will be the form itself. I want the user to change
certain properties, thus changing the form. This works fine, but what I
really want is to take the changes and lock them into a config file, such
that this pc will then display all forms with these attributes.

I don't want the user to be able to change everything - for example, I don't
want a standard form size, nor a standard cursor, but I do want the user to
be able to select the font, font size, form backcolor, etc. So I have to be
able to include only certain properties in the propertygrid. Then of course
I need to trap the selected values and lock them into global variables, them
rebuild the config file to reflect this (when the use selects and 'update'
button).

Thanks for any help with all of this.

Bernie Yaeger
Nov 20 '05 #1
4 2858
Cor
Hi Bernie,

I think you are on the border where to take the registry or a config.file.

Where you are talking about are runtime properties, maybe you can save them
also at the end in your config. But I think this is real the registry.

The registry is very easy to use in VB.net

I would not take the registry property because you only want to change the
properties the user can use, you can that make as nice as you want using a
trackbar and things like that I think.

But I asume you know that already.

Cor
How can I set the browsableattributes of the control that has been selected (selectedobject) by the propertygrid?

Here's what I'm after - I want to open a form with a propertygrid in it.
The selectedobject will be the form itself. I want the user to change
certain properties, thus changing the form. This works fine, but what I
really want is to take the changes and lock them into a config file, such
that this pc will then display all forms with these attributes.

I don't want the user to be able to change everything - for example, I don't want a standard form size, nor a standard cursor, but I do want the user to be able to select the font, font size, form backcolor, etc. So I have to be able to include only certain properties in the propertygrid. Then of course I need to trap the selected values and lock them into global variables, them rebuild the config file to reflect this (when the use selects and 'update'
button).

Thanks for any help with all of this.

Bernie Yaeger

Nov 20 '05 #2
Bernie,
In addition to Cor's comments.

I don't have a specific example, have you considered using a proxy object?

Instead of passing the Form or Control itself to the PropertyGrid, pass your
own object to the PropertyGrid.

Your proxy object would need to implement the
System.ComponentModel.ICustomTypeDescriptor to limit the properties that are
displayed by the Property Grid. System.ComponentModel.TypeDescriptor has a
number of useful helper functions that your implementation of
ICustomTypeDescriptor could use.

For details on the property grid see:

http://msdn.microsoft.com/library/de...ngpropgrid.asp

http://msdn.microsoft.com/library/de...etpropbrow.asp

Hope this helps
Jay

"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:O6*************@TK2MSFTNGP11.phx.gbl...
How can I set the browsableattributes of the control that has been selected (selectedobject) by the propertygrid?

Here's what I'm after - I want to open a form with a propertygrid in it.
The selectedobject will be the form itself. I want the user to change
certain properties, thus changing the form. This works fine, but what I
really want is to take the changes and lock them into a config file, such
that this pc will then display all forms with these attributes.

I don't want the user to be able to change everything - for example, I don't want a standard form size, nor a standard cursor, but I do want the user to be able to select the font, font size, form backcolor, etc. So I have to be able to include only certain properties in the propertygrid. Then of course I need to trap the selected values and lock them into global variables, them rebuild the config file to reflect this (when the use selects and 'update'
button).

Thanks for any help with all of this.

Bernie Yaeger

Nov 20 '05 #3
Hi Jay,

The links you provided - especially the first - really get me going in the
right direction. He's doing almost exactly what I'm looking for.

Tx,

Bernie

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:eo**************@TK2MSFTNGP12.phx.gbl...
Bernie,
In addition to Cor's comments.

I don't have a specific example, have you considered using a proxy object?

Instead of passing the Form or Control itself to the PropertyGrid, pass your own object to the PropertyGrid.

Your proxy object would need to implement the
System.ComponentModel.ICustomTypeDescriptor to limit the properties that are displayed by the Property Grid. System.ComponentModel.TypeDescriptor has a
number of useful helper functions that your implementation of
ICustomTypeDescriptor could use.

For details on the property grid see:

http://msdn.microsoft.com/library/de...ngpropgrid.asp
http://msdn.microsoft.com/library/de...etpropbrow.asp
Hope this helps
Jay

"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:O6*************@TK2MSFTNGP11.phx.gbl...
How can I set the browsableattributes of the control that has been selected
(selectedobject) by the propertygrid?

Here's what I'm after - I want to open a form with a propertygrid in it.
The selectedobject will be the form itself. I want the user to change
certain properties, thus changing the form. This works fine, but what I
really want is to take the changes and lock them into a config file, such that this pc will then display all forms with these attributes.

I don't want the user to be able to change everything - for example, I

don't
want a standard form size, nor a standard cursor, but I do want the user

to
be able to select the font, font size, form backcolor, etc. So I have to be
able to include only certain properties in the propertygrid. Then of

course
I need to trap the selected values and lock them into global variables,

them
rebuild the config file to reflect this (when the use selects and

'update' button).

Thanks for any help with all of this.

Bernie Yaeger


Nov 20 '05 #4
Hi Cor,

You are of course correct - the registry is where I intend to place these
settings.

Thanks for your help.

Bernie

"Cor" <no*@non.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi Bernie,

I think you are on the border where to take the registry or a config.file.

Where you are talking about are runtime properties, maybe you can save them also at the end in your config. But I think this is real the registry.

The registry is very easy to use in VB.net

I would not take the registry property because you only want to change the
properties the user can use, you can that make as nice as you want using a
trackbar and things like that I think.

But I asume you know that already.

Cor
How can I set the browsableattributes of the control that has been selected
(selectedobject) by the propertygrid?

Here's what I'm after - I want to open a form with a propertygrid in it.
The selectedobject will be the form itself. I want the user to change
certain properties, thus changing the form. This works fine, but what I
really want is to take the changes and lock them into a config file, such that this pc will then display all forms with these attributes.

I don't want the user to be able to change everything - for example, I

don't
want a standard form size, nor a standard cursor, but I do want the user

to
be able to select the font, font size, form backcolor, etc. So I have to be
able to include only certain properties in the propertygrid. Then of

course
I need to trap the selected values and lock them into global variables,

them
rebuild the config file to reflect this (when the use selects and

'update' button).

Thanks for any help with all of this.

Bernie Yaeger


Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Terry | last post: by
3 posts views Thread by Dave Girvitz | last post: by
1 post views Thread by ANDRES BECERRA | last post: by
6 posts views Thread by Steve Teeples | last post: by
4 posts views Thread by phcmi | last post: by
3 posts views Thread by =?Utf-8?B?U3RldmVU?= | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.