Home Forums WinForms controls Other WinForms controls Code Is Not Deleted When SmartItem Is Deleted

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18042 |

    Whenever I add a Microsoft control to the form, I notice that the code is deleted in the “Windows Form Designer generated code” region whenever I delete the object in the View Designer. This is normal and expected.

    However…

    Whenever I delete a SmartItem control from the View Designer (eg. Menu item, explorer task, etc.), it is not deleting the code for that item in the “Windows Form Designer generated code” region of the form. Doing this, leaves a lot of orphaned objects consuming memory when the application is run.

    This is now the second instance where I am seeing a manual run through the “Windows Form Designer generated code” is needed, when a modification to SmartItems is done (or needed) in the View Designer.

    Reference Post:
    ——————-
    <a href=”http://www.xceedsoft.com/Forums/ShowPost.aspx?PostID=2985″>Moving Menu Items?</a>

    I am using version 3.3 of the SmartUI.

    Imported from legacy forums. Posted by paulplatter (had 2179 views)

    User (Old forums)
    Member
    Post count: 23064

    Ok, I have figured out what the problem is. It seems to be a small bug in the deletion of a control.

    For example, let’s say you add menu item #1 and menu item #2 to a menu bar. Now you decide to delete both of the items. Before you delete the items, take a look at each item’s name.

    For menu item #1, delete it by highlighting the menu item then pressing the delete key. Then for menu item #2, highlight it click the drop-down arrow on the right side of it. Then on the pop up menu, select the Delete menu item.

    Now, open up the code view for the form, and expand the “Windows Form Designer generated code” region. Now take a look through the section declaring all the controls on the form. (eg. They all start with “Friend WithEvents”) Once here, scroll towards the bottom of this list of control declarations, and try to find the menu item variables you deleted earlier.

    You won’t see menu item #1, because it you deleted it using the normal way of deleting a control. But you will see menu item #2 still being declared for some reason, even though it’s already been deleted of the Designer part of the form. If you look further through the windows designer, you will also see other references to the deleted menu item #2.

    So, for now, I would advise no one to delete an object using Delete command in the context menu of an item on the GUI. If so, you’ll just be leaving trash in your form code that is not being used.

    Imported from legacy forums. Posted by paulplatter (had 3099 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.