469,954 Members | 1,766 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Selection of multiple controls on a panel

Hi there,

In my application I have a panel that contains a matrix of user controls.
The user control is fairly simple. It merely draws a circle that represents
an object in my code. The object has certain properties that can be
configured, so each control has a context menu that allows such operations.

However, my application requires setting properties for multiple objects at
once. That would require being able to select multiple controls, and having a
context menu for the selection of controls. You could compare it to selecting
icons of the Windows desktop and right-clicking to do something or configure
something, like deleting or setting properties.

My question is how I would go about doing that?

With kind regards,
Tom Tempelaere.
Nov 17 '05 #1
3 3420
Hi Tom,

I think you need to create an container control by your own, capable of
enumerate the contents, this will allow you to call the "general" context
menu and then execute the order per object.

The listview is an example, but of course it implents this tecnique with its
own custom code.

It seems complex but if you think about a little while you can figure the
solution in 1 day,

Some tips:
1) Trap the event when you drag the mouse, from x,y to your final x,y, so
you get a rectangle
2) Your container should store a matrix with the objects positions.
3) Then you can intersect those points with the rectangle and check which
ones are inside
4) Store those objects references in an array
5) Apply the context menu function to those objects on the array.

I don't know if there is a custom control (or even commercial) around to buy
this feature, but I usually go for the custom ones.

Hope this helps
Salva

"TT (Tom Tempelaere)" wrote:
Hi there,

In my application I have a panel that contains a matrix of user controls.
The user control is fairly simple. It merely draws a circle that represents
an object in my code. The object has certain properties that can be
configured, so each control has a context menu that allows such operations.

However, my application requires setting properties for multiple objects at
once. That would require being able to select multiple controls, and having a
context menu for the selection of controls. You could compare it to selecting
icons of the Windows desktop and right-clicking to do something or configure
something, like deleting or setting properties.

My question is how I would go about doing that?

With kind regards,
Tom Tempelaere.

Nov 17 '05 #2
Hi Tom,

I think you need to create an container control by your own, capable of
enumerate the contents, this will allow you to call the "general" context
menu and then execute the order per object.

The listview is an example, but of course it implents this tecnique with its
own custom code.

It seems complex but if you think about a little while you can figure the
solution in 1 day,

Some tips:
1) Trap the event when you drag the mouse, from x,y to your final x,y, so
you get a rectangle
2) Your container should store a matrix with the objects positions.
3) Then you can intersect those points with the rectangle and check which
ones are inside
4) Store those objects references in an array
5) Apply the context menu function to those objects on the array.

I don't know if there is a custom control (or even commercial) around to buy
this feature, but I usually go for the custom ones.

Hope this helps
Salva

"TT (Tom Tempelaere)" wrote:
Hi there,

In my application I have a panel that contains a matrix of user controls.
The user control is fairly simple. It merely draws a circle that represents
an object in my code. The object has certain properties that can be
configured, so each control has a context menu that allows such operations.

However, my application requires setting properties for multiple objects at
once. That would require being able to select multiple controls, and having a
context menu for the selection of controls. You could compare it to selecting
icons of the Windows desktop and right-clicking to do something or configure
something, like deleting or setting properties.

My question is how I would go about doing that?

With kind regards,
Tom Tempelaere.

Nov 17 '05 #3
Hi Salvador,

I was hoping to find an example or a link that explains how to do this. I
haven't found one yet, hence the question. I'd rather start from an example
but any hint is good.

I will have to think about this a little longer. Problem is that I don't
have a lot of time to code this, and obviously, selecting the controls is not
really the focus of the project.

Thanks for the suggestion, and kind regards,
Tom Tempelaere.

"Salvador" wrote:
Hi Tom,

I think you need to create an container control by your own, capable of
enumerate the contents, this will allow you to call the "general" context
menu and then execute the order per object.

The listview is an example, but of course it implents this tecnique with its
own custom code.

It seems complex but if you think about a little while you can figure the
solution in 1 day,

Some tips:
1) Trap the event when you drag the mouse, from x,y to your final x,y, so
you get a rectangle
2) Your container should store a matrix with the objects positions.
3) Then you can intersect those points with the rectangle and check which
ones are inside
4) Store those objects references in an array
5) Apply the context menu function to those objects on the array.

I don't know if there is a custom control (or even commercial) around to buy
this feature, but I usually go for the custom ones.

Hope this helps
Salva

"TT (Tom Tempelaere)" wrote:
Hi there,

In my application I have a panel that contains a matrix of user controls.
The user control is fairly simple. It merely draws a circle that represents
an object in my code. The object has certain properties that can be
configured, so each control has a context menu that allows such operations.

However, my application requires setting properties for multiple objects at
once. That would require being able to select multiple controls, and having a
context menu for the selection of controls. You could compare it to selecting
icons of the Windows desktop and right-clicking to do something or configure
something, like deleting or setting properties.

My question is how I would go about doing that?

With kind regards,
Tom Tempelaere.

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by David | last post: by
1 post views Thread by MichaƂ Januszczyk | last post: by
9 posts views Thread by Quina | last post: by
2 posts views Thread by Darren Carter | last post: by
14 posts views Thread by =?Utf-8?B?UHVjY2E=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.