CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 1999
    Posts
    84

    Minimize the control

    I have put an OCX which is created by us on to a form.

    When I minimize the form, the OCX is still being displayed. To solve this problem we created a method in the OCX, which minimize the control also when called.

    But now when clicked on the ShowDesktop icon from the taskbar, the form is getting minimized but not the control.

    Please help me with a way to minimize the control when the ShowDesktop icon is clicked.





    Thanks
    Harini

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Minimize the control

    Have you tried to call the method to minimize ocx also in resize event of form wher ocx is?
    Ie:
    private sub form_resize
    if me.windowstate= vbminimized then
    'call your method to minimize ocx
    end if
    end sub
    Hope this help
    (strange ocx you've made...!:-))

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Jul 1999
    Posts
    84

    Re: Minimize the control

    Yes the method is called when we minimize the form from VB. Now the problem is when we click on Show Desk top icon which is present at the bottom left corner of screen, all the applications including VB gets minimized. However at this time the methodof minimizing OCX is not getting called as the Form Resize itself is not getting called

    Thanks
    Harini

  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Minimize the control

    Sorry i mismatched the point. I am afraid I cannot help more than give you a little hint:
    As your parent form (the form where your ocx is) do minimize, you could have a timer (or timer function) in your ocx to test every half a second for parent's windowstate, and if you find it is minimized, you can call for your method inside the ocx itself. Do not forget to stop the timer on closing ocx.
    Hope this help,
    Cesare Imperiali

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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