By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,290 Members | 1,439 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,290 IT Pros & Developers. It's quick & easy.

PropertiesGrid and opening forms

P: n/a
Hi,

I have a 3rd party control(infragistics) that seems to alter the VS.NET IDE
properties grid so that there are three areas instead of two areas in the
VS.NET IDE properties grid. There is a new middle area that looks a lot like
the description area except it has hyperlinks that open forms that allow the
currently displayed control to be edited.

Does anyone know how to do this with the properties grid in VS.NET? Is the
properties grid used in the IDE the same as the one that you can use in your
projects?

Thanks,
Shawn
Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
You can do this by setting the Description And Category attributes of your
component. Also, if you have a property of your control that has an enum
for instance, it'll show up as a combo box in the property grid. If you
have an indexer, you'll have the little button that will pop up the form to
let you add items. The behavoir of things inside the grid is largely
dependent on how you set up your properties, but to get the Description and
Category to change, it's as easy as adding an attribute
<Description("Whateever you want it to say"), Category("Behavior"),
DefaultValue(Whatever You want Here")

HTH,

Bill
"Shawn Hogan" <NOSPAM> wrote in message
news:O#**************@tk2msftngp13.phx.gbl...
Hi,

I have a 3rd party control(infragistics) that seems to alter the VS.NET IDE properties grid so that there are three areas instead of two areas in the
VS.NET IDE properties grid. There is a new middle area that looks a lot like the description area except it has hyperlinks that open forms that allow the currently displayed control to be edited.

Does anyone know how to do this with the properties grid in VS.NET? Is the
properties grid used in the IDE the same as the one that you can use in your projects?

Thanks,
Shawn

Nov 20 '05 #2

P: n/a
The area i'm talking about isn't the "description" area... it's another one
that's between the grid and tre description area. Inside of this area is a
list of links which open up forms.

The reason why i'm so interested in this area is because i want to open a
form to edit properties in the selected object from the properties grid. The
catch is that the form cannot be modal. I need to interact with the
application when i have the form open.

Shawn

"William Ryan [eMVP]" <do********@comcast.nospam.net> wrote in message
news:uT**************@TK2MSFTNGP09.phx.gbl...
You can do this by setting the Description And Category attributes of your
component. Also, if you have a property of your control that has an enum
for instance, it'll show up as a combo box in the property grid. If you
have an indexer, you'll have the little button that will pop up the form to let you add items. The behavoir of things inside the grid is largely
dependent on how you set up your properties, but to get the Description and Category to change, it's as easy as adding an attribute
<Description("Whateever you want it to say"), Category("Behavior"),
DefaultValue(Whatever You want Here")

HTH,

Bill
"Shawn Hogan" <NOSPAM> wrote in message
news:O#**************@tk2msftngp13.phx.gbl...
Hi,

I have a 3rd party control(infragistics) that seems to alter the VS.NET

IDE
properties grid so that there are three areas instead of two areas in the VS.NET IDE properties grid. There is a new middle area that looks a lot

like
the description area except it has hyperlinks that open forms that allow

the
currently displayed control to be edited.

Does anyone know how to do this with the properties grid in VS.NET? Is the properties grid used in the IDE the same as the one that you can use in

your
projects?

Thanks,
Shawn


Nov 20 '05 #3

P: n/a
I just opened Infragistics and see what you are talking about. I'm not sure
off of the top of my head, but I have an idea..I'll get back to you
shortly..

Bill
"Shawn Hogan" <NOSPAM> wrote in message
news:OY**************@TK2MSFTNGP09.phx.gbl...
The area i'm talking about isn't the "description" area... it's another one that's between the grid and tre description area. Inside of this area is a
list of links which open up forms.

The reason why i'm so interested in this area is because i want to open a
form to edit properties in the selected object from the properties grid. The catch is that the form cannot be modal. I need to interact with the
application when i have the form open.

Shawn

"William Ryan [eMVP]" <do********@comcast.nospam.net> wrote in message
news:uT**************@TK2MSFTNGP09.phx.gbl...
You can do this by setting the Description And Category attributes of your
component. Also, if you have a property of your control that has an enum for instance, it'll show up as a combo box in the property grid. If you
have an indexer, you'll have the little button that will pop up the form

to
let you add items. The behavoir of things inside the grid is largely
dependent on how you set up your properties, but to get the Description

and
Category to change, it's as easy as adding an attribute
<Description("Whateever you want it to say"), Category("Behavior"),
DefaultValue(Whatever You want Here")

HTH,

Bill
"Shawn Hogan" <NOSPAM> wrote in message
news:O#**************@tk2msftngp13.phx.gbl...
Hi,

I have a 3rd party control(infragistics) that seems to alter the
VS.NET IDE
properties grid so that there are three areas instead of two areas in the VS.NET IDE properties grid. There is a new middle area that looks a
lot like
the description area except it has hyperlinks that open forms that
allow the
currently displayed control to be edited.

Does anyone know how to do this with the properties grid in VS.NET? Is the properties grid used in the IDE the same as the one that you can use

in your
projects?

Thanks,
Shawn



Nov 20 '05 #4

P: n/a
Any control can show these, but it does require a small amount of work:

Your control needs to have a designer defined (that is,
[Designer(typeof(SomeDesigner))]
public class SomeControl : System.Windows.Forms.UserControl // Or
Control, or an asp.net control whatever. it must inherit from component

Your designer will most likely inherit from ControlDesigner, or some such.
To add these "hyperlinks", you add Verbs. You can do this by overriding the
"Verbs" property of your designer ...

public class SomeDesigner : ControlDesigner{
....
DesignerVerbCollection _verbs;
public override DesignerVerbCollection Verbs{
get{
if(_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs.Add (
new DesignerVerb("Cool Action", new
EventHandler(CoolAction_Handler)));
}
return _verbs;
}
}
....

Then you just code the function you passed in as a delegate above:

private void CoolAction_Handler(object sender, EventArgs e){
//Do something neat
}

"William Ryan [eMVP]" <do********@comcast.nospam.net> wrote in message
news:Oo**************@TK2MSFTNGP12.phx.gbl...
I just opened Infragistics and see what you are talking about. I'm not sure off of the top of my head, but I have an idea..I'll get back to you
shortly..

Bill
"Shawn Hogan" <NOSPAM> wrote in message
news:OY**************@TK2MSFTNGP09.phx.gbl...
The area i'm talking about isn't the "description" area... it's another

one
that's between the grid and tre description area. Inside of this area is a
list of links which open up forms.

The reason why i'm so interested in this area is because i want to open a form to edit properties in the selected object from the properties grid.

The
catch is that the form cannot be modal. I need to interact with the
application when i have the form open.

Shawn

"William Ryan [eMVP]" <do********@comcast.nospam.net> wrote in message
news:uT**************@TK2MSFTNGP09.phx.gbl...
You can do this by setting the Description And Category attributes of your component. Also, if you have a property of your control that has an enum for instance, it'll show up as a combo box in the property grid. If you have an indexer, you'll have the little button that will pop up the
form to
let you add items. The behavoir of things inside the grid is largely
dependent on how you set up your properties, but to get the
Description and
Category to change, it's as easy as adding an attribute
<Description("Whateever you want it to say"), Category("Behavior"),
DefaultValue(Whatever You want Here")

HTH,

Bill
"Shawn Hogan" <NOSPAM> wrote in message
news:O#**************@tk2msftngp13.phx.gbl...
> Hi,
>
> I have a 3rd party control(infragistics) that seems to alter the VS.NET IDE
> properties grid so that there are three areas instead of two areas
in the
> VS.NET IDE properties grid. There is a new middle area that looks a lot like
> the description area except it has hyperlinks that open forms that allow the
> currently displayed control to be edited.
>
> Does anyone know how to do this with the properties grid in VS.NET?
Is the
> properties grid used in the IDE the same as the one that you can use

in your
> projects?
>
> Thanks,
> Shawn
>
>



Nov 20 '05 #5

P: n/a
Sorry that was in c#.. I lost track of the NG I was in! (also note that I
have no VS.NET here... this code is almost-code, as it's never been syntax
checked. Hopfully the concepts don't suffer.)

The concept is the same -> add the Designer attribute to your class:
<Designer ... >
Public Class SomeControl
Inherits System.Windows.Forms.Control
....

Then implement the designer and override the Verbs Property.
Private _verbs As DesignerVerbCollection
Public Property Verbs As DesignerVerbCollection
Get
If _verbs Is Nothing Then
_verbs.Add( _
new DesignerVerb( "Cool Action", AddressOf( CoolAction_Handler)))
End If
Return _verbs
End Get
End Property
....
Then implement the handler:

Private Sub CoolAction_Handler( sender As Object, e As EventArgs)
'something neat goes here.
End Sub
"Philip Rieck" <st***@mckraken.com> wrote in message
news:On****************@tk2msftngp13.phx.gbl...
Any control can show these, but it does require a small amount of work:

Your control needs to have a designer defined (that is,
[Designer(typeof(SomeDesigner))]
public class SomeControl : System.Windows.Forms.UserControl // Or
Control, or an asp.net control whatever. it must inherit from component

Your designer will most likely inherit from ControlDesigner, or some such.
To add these "hyperlinks", you add Verbs. You can do this by overriding the "Verbs" property of your designer ...

public class SomeDesigner : ControlDesigner{
...
DesignerVerbCollection _verbs;
public override DesignerVerbCollection Verbs{
get{
if(_verbs == null)
{
_verbs = new DesignerVerbCollection();
_verbs.Add (
new DesignerVerb("Cool Action", new
EventHandler(CoolAction_Handler)));
}
return _verbs;
}
}
...

Then you just code the function you passed in as a delegate above:

private void CoolAction_Handler(object sender, EventArgs e){
//Do something neat
}

"William Ryan [eMVP]" <do********@comcast.nospam.net> wrote in message
news:Oo**************@TK2MSFTNGP12.phx.gbl...
I just opened Infragistics and see what you are talking about. I'm not sure
off of the top of my head, but I have an idea..I'll get back to you
shortly..

Bill
"Shawn Hogan" <NOSPAM> wrote in message
news:OY**************@TK2MSFTNGP09.phx.gbl...
The area i'm talking about isn't the "description" area... it's another
one
that's between the grid and tre description area. Inside of this area
is a list of links which open up forms.

The reason why i'm so interested in this area is because i want to
open
a form to edit properties in the selected object from the properties
grid.
The
catch is that the form cannot be modal. I need to interact with the
application when i have the form open.

Shawn

"William Ryan [eMVP]" <do********@comcast.nospam.net> wrote in message
news:uT**************@TK2MSFTNGP09.phx.gbl...
> You can do this by setting the Description And Category attributes
of your
> component. Also, if you have a property of your control that has an enum
> for instance, it'll show up as a combo box in the property grid. If you > have an indexer, you'll have the little button that will pop up the form to
> let you add items. The behavoir of things inside the grid is
largely > dependent on how you set up your properties, but to get the

Description and
> Category to change, it's as easy as adding an attribute
> <Description("Whateever you want it to say"), Category("Behavior"),
> DefaultValue(Whatever You want Here")
>
> HTH,
>
> Bill
> "Shawn Hogan" <NOSPAM> wrote in message
> news:O#**************@tk2msftngp13.phx.gbl...
> > Hi,
> >
> > I have a 3rd party control(infragistics) that seems to alter the

VS.NET
> IDE
> > properties grid so that there are three areas instead of two areas in the
> > VS.NET IDE properties grid. There is a new middle area that looks
a lot
> like
> > the description area except it has hyperlinks that open forms that

allow
> the
> > currently displayed control to be edited.
> >
> > Does anyone know how to do this with the properties grid in
VS.NET? Is the
> > properties grid used in the IDE the same as the one that you can

use in
> your
> > projects?
> >
> > Thanks,
> > Shawn
> >
> >
>
>



Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.