473,657 Members | 2,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3635
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3520
by: Bil Muh | last post by:
Esteemede Developers, I would like to Thank All of You in advance for your sincere guidances. I am developing a software using Visual C++ .NET Standard Edition with Windows Form (.NET) template. Briefly -------------------------------------------------------------------------------------------- I need to create dynamically some controls on the forms, and display these
3
1749
by: David | last post by:
Hi, I have a page that will need to dynamically use 4 different user controls based on a Query String passed to it. Currently I have the @Register for each control and the <tagprefix: tagname> in a case statement depending on the quesry string. However, when the page is loaded, all 4 user controls seem to be compiled and instantiated when the page runs. Therefore causing various problems when submitting the page. Is there a way to...
2
5737
by: Matt Sawyer | last post by:
Hi, I'm attempting to do a drag and drop operation from one listbox to another. I have my listboxes setup with SelectionMode = MultiExtended so that I can use the shift key, cntrl key, etc. to make multiple selections. The problem I am having is that when I use the shift key to select a range of items, I first click on one item (item gets highlighted), then, holding down the shift key, I select another item (the range of items gets...
0
2799
by: Jeff Tolman | last post by:
Hi! I keep getting this error, but I'm not sure why. When I turn off the trace flag, I only get it at certain times. Even with the trace flag set to true, I don't understand the output diagnostics. It shows a list of the controls on the page (or is this a partial list?) and I don't see where it has found multiple controls with IDs of '_ctl24'. Here is my list of controls. Any help or suggestions are MUCH appreciated! Thanks!
1
1454
by: Michał Januszczyk | last post by:
I have the following code on my aspx page <%if(user_status==1){%><ctl:state1 runat="server" id="aaa"></ctl:state1><%}else if(user_status==2){%><ctl:state2 runat="server" id="bbb"></ctl:state2><%}else if(user_status==3){%><ctl:state3 runat="server" id="ccc"></ctl:state3><%}else if(user_status==4){%><ctl:state4 runat="server" id="ddd"></ctl:state4><%}% When I load the page, all four controls are inilialized (page_loa of each is fired ...
1
1912
by: Novice | last post by:
Hey all, I have finally managed to create a Custom WebControl and am using a technique from another programmer to maintain state between pages - I would just like to validate this idea. Basically I have created a Custom Web Control that is capable of generating multiple webpages. It actually only creates one webpage, but hides Panels (that contain the web controls - TextBox's, Labels, etc) to give the impression that the user is...
9
4622
by: Quina | last post by:
Hi. Is there someone that can tell me how can I have multiple screens on the the same form, displaying only on at the time? Thank you all for any replys. João Carias
2
2363
by: Darren Carter | last post by:
Hi, I have mutliple asp:Panel controls on a single page, each with a default button defined (each default button resides within its respective asp:Panel). All validation controls and buttons within each panel also have separate ValidationGroups defined. When an asp:Textbox has focus in one of the Panels and I press the enter key, my validation works great. If I press the enter key a second time, the first button on the page's onClick...
14
3357
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using VS2005 and .net 2.0. I'm creating an application that has 3 forms. I want allow users to move forward and backward with the forms and retain the data users have entered. I thought I'll make the inactive forms invisible but this is creating a memory corruption problem when user close the form2 or form3 and not the formMain. My main form has a Next button which makes the main form invisible and starts a new form which I'll...
0
8829
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8734
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8508
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6172
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5633
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1627
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.