Results 1 to 2 of 2

Thread: How to load controls in run time

  1. #1
    Cris
    Guest

    How to load controls in run time

    Say I load controls from a menu control on a MDI form like this:

    Private sub mnuNewdevice_click()
    load commandbutton(index)
    commandbutton(index).picture=....
    commandbutton(index).caption=....
    commandbutton(index).left=...
    commandbutton(index).top=...
    commandbutton(index).height=...
    commandbutton(index).width=...
    ...
    commandbutton(index).visible=true
    End sub

    The trouble is that this code load the control on the MDI form, not in other different form. In short, how can I load controls on a not current form in run time?

    By the way, the following code not work:

    load frmDesing.commandbutton(index)

    Or,

    frmDesign. load commandbutton(index)

    Or,

    frmDesign = load(commandbutton(index))

    Thanks in advance an sorry for being so long..

    Cris

  2. #2
    Addicted Member
    Join Date
    Jul 2001
    Location
    Minnesota, USA
    Posts
    134
    You could create a hidden button on each form, then have its click event call a special LoadControl function that you create. That way, you could possibly tell a specific form to load a control?

    Hope that helps.
    The answer is 42. Sadly, you can't typecast the "answer" data type to the "question" data type.

    Code:
    Take.Me( To( Your.Leader ) )

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