473,397 Members | 2,056 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,397 software developers and data experts.

Limiting a controls parent.

I want to create a set of Activity Diagram controls for process control.

I need to create a base Diagram control that acts as a container for the
Activity controls ( StartPoint, EndPoint, Actvity, Decision, Message,...).

How do I implement it such that the only place I can drop an Activity
control is on a Activity Diagram?

I'm an experienced Delphi developer and I'm just getting started in C#.
There appears to be significant crossover between the two languages.
Aug 1 '08 #1
4 1527
On Aug 1, 9:46*am, "Andrew" <and...@yahoo.comwrote:
I want to create a set of Activity Diagram controls for process control.

I need to create a base Diagram control that acts as a container for the
Activity controls ( StartPoint, EndPoint, Actvity, Decision, Message,...)..

How do I implement it such that the only place I can drop an Activity
control is on a Activity Diagram?

I'm an experienced Delphi developer and I'm just getting started in C#.
There appears to be significant crossover between the two languages.
hi

I do not undersstand your question, are you asking how to design your
classes or your interface?
Aug 1 '08 #2
Please understand I'm just getting started in C# but have 10+ years of
experience in Delphi, so if I'm not clear it's mostlikely because I don't
have C# on my fingertips yet.

I'm quite sure I can design the underlying class structure for the
implementation I'm looking for. It's the details on how Visual Studio
creates components and assigns them to parent controls during the design
process.

What I'd do in Delphi is create the Diagram control first from a TPanel
control. I would then write the Activity controls from TComponents. In the
constructor for the Activity controls I would check and see if the partent
was a Diagram control. If it was not, I would display a message then have
the Activity control commit suiside.

I'm just not sure when the parent is assigned if C# and if the constructor
is the best place to check the parent class in C#.

This is all just for completeness. I want to design a set of controls I can
use over and over again and pass on to others in our group.

"Ignacio Machin ( .NET/ C# MVP )" <ig************@gmail.comwrote in
message
news:97**********************************@c58g2000 hsc.googlegroups.com...
On Aug 1, 9:46 am, "Andrew" <and...@yahoo.comwrote:
I want to create a set of Activity Diagram controls for process control.

I need to create a base Diagram control that acts as a container for the
Activity controls ( StartPoint, EndPoint, Actvity, Decision, Message,...).

How do I implement it such that the only place I can drop an Activity
control is on a Activity Diagram?

I'm an experienced Delphi developer and I'm just getting started in C#.
There appears to be significant crossover between the two languages.
hi

I do not undersstand your question, are you asking how to design your
classes or your interface?
Aug 1 '08 #3
On Fri, 01 Aug 2008 07:31:51 -0700, Andrew <an****@yahoo.comwrote:
[...]
What I'd do in Delphi is create the Diagram control first from a TPanel
control. I would then write the Activity controls from TComponents. In
the
constructor for the Activity controls I would check and see if the
partent
was a Diagram control. If it was not, I would display a message then
have
the Activity control commit suiside.

I'm just not sure when the parent is assigned if C# and if the
constructor
is the best place to check the parent class in C#.
I question the wisdom of designing the control so that it may only have
some specific type of control as its parent. IMHO, it's much better to
define some specific set of functionality that the parent is required to
have and check for that as needed.

That said, in .NET, the control's parent is not known during construction,
and in fact the parent can change over time (that is, some code could
specifically move the control).

The most appropriate place to check for some qualification of the
control's parent would be in the OnParentChanged() method. Override that,
and respond in whatever way is appropriate for your code if the new parent
isn't qualified. IMHO, all you really should do is throw an exception
(e.g. InvalidOperationException), but I suppose you could actually have
the control remove itself from the new parent and dispose itself (but
there's not really a good way for the control to inform its parent,
especially a parent that wasn't the right parent, to be aware of this...so
I'd really recommend against it).
This is all just for completeness. I want to design a set of controls I
can
use over and over again and pass on to others in our group.
Personally, I'd avoid trying to enforce a specific parent. But if you
really insist, hopefully the above would be helpful information.

Pete
Aug 1 '08 #4
AJ
I've a feeling that you _can_ do what you want to... the example code
I'm thinking of comes from
http://windowsclient.net/articles/shapedesigner.aspx
so have a look through that. But it was a while ago I tried this, so I
might be mis-remembering.
In article <48**********************@news.aliant.net>, an****@yahoo.com
says...
I want to create a set of Activity Diagram controls for process control.

I need to create a base Diagram control that acts as a container for the
Activity controls ( StartPoint, EndPoint, Actvity, Decision, Message,...).

How do I implement it such that the only place I can drop an Activity
control is on a Activity Diagram?

I'm an experienced Delphi developer and I'm just getting started in C#.
There appears to be significant crossover between the two languages.
Aug 1 '08 #5

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

Similar topics

1
by: Brian Adams | last post by:
I have a UserControl which draws using GDI+ on the top 40 pixels or so. Everything below that is available for users to place other controls on (like buttons, etc.) What I need to be able to do...
5
by: Zürcher See | last post by:
The Control class has the Parent property that is readonly. When the control is added to a controls collection of another control the Parent property refers to that control. "Who" set the Parent...
0
by: DotNetJunkies User | last post by:
Hi All I am developing a site using ASP.Net I want to develop a site that generates forms ( textbox,check boxes etc) automatically ie is from database itself depending on the no of rows in the...
0
by: mawi | last post by:
Hello, Description: I create panels with some controls on a page using a new panel button. One of the controls on each panel is the "close panel" button that is supposed to close the panel it...
1
by: Homam | last post by:
So I have a composite paging control that shoulld be positioned on the page like this: PagNav ResultSetDisplay PagNav I know that I can't resuse the PagNav more than once in the form, so I...
5
by: tshad | last post by:
I have a PageInit.ascx that I want to put in all my pages and have it execute only once during the "not IsPostback" section. I also need it to execute first before anything else. I have it set...
6
by: Ronald S. Cook | last post by:
We have a Windows app that has one main form (a shell, sort of). We then load user controls into a panel on the form depending on what the user has selected. Our current code to unload the...
4
by: TS | last post by:
Steven, i lost this message conversation from outlook express and made a post online (see last one on this page). Please answer it as it hasn't been yet. thanks The clientID of our controls...
2
by: Bob Johnson | last post by:
..NET 3.5: I have placed two controls at the top of an Mdi parent form. The top-most control is a Panel that is docked to the Top. Immediately below the Panel is a user control that is Anchored to...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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,...
0
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...

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.