|
-
Jan 20th, 2004, 09:25 AM
#1
Thread Starter
Frenzied Member
inheritance [RESOLVED]
When you right-click a control and then select "copy", then paste that copy elsewhere, is that the same as creating a new instance and slapping in the clause "inherits yadda yadaa" in the new control somewhere?
If not, what are the differences? Obviousely, copying a control has advantages...sizes and colors will be consistant and quickly applied for example.
but, is this the same as "inheritance" ?
Last edited by Andy; Feb 11th, 2004 at 09:46 PM.
-
Jan 20th, 2004, 09:40 AM
#2
Sleep mode
When you copy a control , you actuall copy the control design with all it's properties (name , font ,color ...etc ) with no code . But when you inherit a control you'll gain access to its all code including methods .
-
Jan 20th, 2004, 09:47 AM
#3
Thread Starter
Frenzied Member
ok. so is that to say you can't have use the members with the copied control? If not, I'm in t r o u b l e I have tried to save time by copying my controls that I needed to have the same look and size etc, etc.
lol
-
Jan 20th, 2004, 09:52 AM
#4
Sleep mode
If you don't want to go inheritance route , then just copy your controls . After that you need to copy the code to the copied controls . Since they have the same names , this shouldn't be a problem . They will run as if the original .
-
Jan 20th, 2004, 10:53 AM
#5
Inheritance is when used when you want to make a new kind of control based on an existing control. So if you wanted to add some new functionality to a combobox then you would inherit from it add the functionality and have a new type of combobox. If you just want several controls on a form or in a project that are the same then I would not use inheritance but copy them as you have done.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|