CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Posts
    95

    unloading an indexed frame

    Hello I have a main form with a protoype frame (index 0) with a few indexed buttons in it...I load in addition frames as needed:

    Code:
    If intFrameCount <> 0 Then Load FrameProto(intFrameCount)
    With FrameProto(intFrameCount)
        .Caption = strParsedstr(0)
        .Left = strParsedstr(2)
    etc
    Now later on I want to kill off all of these loaded frames (basically so I can reload them with some slight updates--possibly a different number of radio buttons)...I don't need to kill frameProto(0), since it is there at design time.

    but when I try to unload, say frame 1 (Unload FrameProto(1) ), I get error 365 unable to unload within this context....I tried doing it by a timer method , but same problem.

    any ideas?

  2. #2
    Join Date
    Apr 2009
    Posts
    394

    Re: unloading an indexed frame

    I'm betting you first need to unload the controls it contains first...



    Good Luck

  3. #3
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: unloading an indexed frame

    Bet won.
    You can unload all controls on a frame (provided they are indexed, too) like:
    Code:
    Dim c As Control
    For Each c in Me.Controls
          If c.Container Is Frame(n) Then Unload c
    Next

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

Featured