Results 1 to 3 of 3

Thread: Creating new checkbox in groupbox + Saving changes

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2011
    Posts
    3

    Creating new checkbox in groupbox + Saving changes

    Hello,

    I would like to use code to create a checkbox with default properties and place it at a certain position in a groupbox. For example, i would like to do this by pressing a button and that i can give in the name and tag by use of an imputbox.

    Also, i have noticed that if something like this is done, these changes aren't permanent and don't apply to the designer nor the code in VB. Is there a way to let the newly created checkboxes appear in the designer? And what about permanently deleting checkboxes by pressing a button. With "Dispose()" it isn't deleted from the designer...

    Thanks in advance.

    Im2be

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Creating new checkbox in groupbox + Saving changes

    Think about it. A car manufacturer has a design for a particular model. It makes lots and lots of cars of that model each year. If you buy one of those cars and remove the hub caps, does that mean that every car the manufacturer makes based on that model in the future will not have hub caps? What if you added a spoiler? Would every car they make have a spoiler from then on? The answers are, of course, no. Your situation is exactly the same. Your aren't creating a form object in the designer. You're creating a form class. At run time, you create an instance of that class. You can create as many instances as you like. Any change that you make to one of those instances will not affect any other instance, past, present or future. Any future instances that you create will be based on the original design, not copies of one particular object that you made changes to.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: Creating new checkbox in groupbox + Saving changes

    You may be able to create an add-in to do what you want. But I do not quite follow you, I thought I was until I got to the "Dispose".
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

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