473,395 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Control Question

hi

how would I do the following :

i have a control which has a property which is an array of that control...

i.e. kinda like how a treenode has treenode's as children

but i want to be able to only add controls which are already on the form ...

i'm guessing i would need to write some kinda collectioneditor - but i
don't know how to do this...

can anyone help me???

thanx
g
Nov 17 '05 #1
4 956
Can you be more specific on what the host control is and what the
"sub-controls" are?

"graeme g" wrote:
hi

how would I do the following :

i have a control which has a property which is an array of that control...

i.e. kinda like how a treenode has treenode's as children

but i want to be able to only add controls which are already on the form ...

i'm guessing i would need to write some kinda collectioneditor - but i
don't know how to do this...

can anyone help me???

thanx
g

Nov 17 '05 #2
basically i'm trying to develop a scheduling application -

a task can have one or many subtasks - so i want one task component and
be able to attach the subcomponents to it so that it can draw connected
lines between them e.g.

TASK 1 ------- TASK 2 ------- TASK3
|
|
TASK 4 -------TASK 5

or something like that...

Thanks
g
Nov 17 '05 #3
What i would do is create a custom control and provide the base control.
Inside the control def create a method that adds another control(task) to the
parent. Something like: add(string title, string desc) then in the def build
the GUI. Let me know if this is what you are looking to do.

"graeme g" wrote:
basically i'm trying to develop a scheduling application -

a task can have one or many subtasks - so i want one task component and
be able to attach the subcomponents to it so that it can draw connected
lines between them e.g.

TASK 1 ------- TASK 2 ------- TASK3
|
|
TASK 4 -------TASK 5

or something like that...

Thanks
g

Nov 17 '05 #4
As far as code goes, I would create/use whatever base class you have as
a "task" -
Let's call it: TaskItem

You will also want a TaskItemCollection class that inherits
System.Collections.CollectionBase.

Within the TaskItem class you can then have a property that is of the
type TaskItemCollection.

basically:

public class TaskItem
{
public TaskItemCollection TaskItems;
// Any other properties, methods, classes, etc...
}

public class TaskItemCollection : System.Collections.CollectionBase
{
// Add code to implement the methods of
System.Collections.CollectionBase
}

As far as the visual connection, perhaps have TaskItem inherit from a
class in System.Drawing, or System.Windows.Forms - then add a method
(.ConnectChildren()) to create the visual connectors.

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: news.microsoft.com | last post by:
I have a user control with four option buttons depending which option button is pressed I store a score into session object. On the load event of a control the session object is set to 0. There is...
4
by: Marius Trælnes | last post by:
Hello! I am about to make a class/control that creates tabbing functionality. The result is in HTML/CSS/JavaScript output. My question is: Within the tabs I want to simply add user controls...
1
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
5
by: Richard Brown | last post by:
Ok, I've been looking through the .NET SDK docs and stuff. I'm wondering if you can provide a control extender that does generic validation or functionality just by dropping it on the form. For...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
1
by: Mark Olbert | last post by:
I have a "master" composite control which, in turn, holds an instance of a "detail" composite control (the "master" control will ultimately contain multiple instances of the "detail" control, but...
3
by: Hamed | last post by:
Hello Is it possible to get a control (e.g. a checkbox) and make a Graphics object or a Bitmap object of current face of the control? I want to implement Sparse property for a ColumnStyle so I...
15
by: Hamed | last post by:
Have I posted the message to wrong newsgroup? Or Does the question is so much strage? Would someone please kindly direct me to a true newsgroup or resource? Best Regards Hamed
1
by: Alec MacLean | last post by:
Hi, Outline of problem: I've built a set of user controls that are used to output questions for a survey and gather the responses using simple radio buttons. I'm adding an optional textbox...
2
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
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...

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.