473,569 Members | 2,721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1542
On Aug 1, 9:46*am, "Andrew" <and...@yahoo.c omwrote:
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******** *************** ***********@c58 g2000hsc.google groups.com...
On Aug 1, 9:46 am, "Andrew" <and...@yahoo.c omwrote:
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.c omwrote:
[...]
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. InvalidOperatio nException), 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.co m
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
2048
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 is lower the ClientRectangle so that other controls can't draw above the 40 pixel line. Basically, I want to make x=0, y=40 on the UserControl look...
5
2369
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 property? How to implement this "mechanism"? public abstract class MyControl { private MyControl parent; public MyControl Parent{get{return...
0
2292
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 table in database. That is to get as many textboxes and checkboxes as there are rows in table What I am doing right now is creating new text box,...
0
2051
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 is on. This works fine only if one closes the panels from last panel. Otherwise two clicks is necessary for the last panel - ie, if you press add 3...
1
1198
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 instantiate a couple of instances, PagNavTop and PagNavBottom, and thus I end up with:
5
2330
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 as: <%@ Register TagPrefix="fts" TagName="pageInit" Src="/controls/pageInit.ascx" %> .... <body>
6
4712
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 existing user control and load the newly selected one is pretty bulky. Every time we add a new user control to the project, we have to add some code in...
4
2685
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 have become very long since we have 2 master pages that our pages inherit from. Some team members at
2
2800
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 the Top, Left, and Right. At runtme I can drag Mdi child forms toward the top of the Mdi parent. The child forms slide beneath the user control...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8119
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...
1
7668
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...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
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...
0
5218
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...
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
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...

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.