Results 1 to 5 of 5

Thread: inheritance [RESOLVED]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    Question 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.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    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 .

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    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

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    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 .

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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
  •  



Click Here to Expand Forum to Full Width