Form events problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Funky
    New Member
    • Mar 2008
    • 13

    #1

    Form events problem

    Hello!

    I have a problem. I have to change the size of a control added to a Form when the user resizes the Form. I use the Resize event and change the size of the control in the method which is called with the Resize event. So I implemented the docking behaving of the control because it is a part of a third-party library and it doesn't have the docking property. But if the user changes the size of a Form that the control doesn't fit in the form after resizing so the width must decrease, the control totaly collapses. I solved this with use of the ResizeBegin event. When it is called, the controls size changes to width=1, height=1 and then when the Resize event is triggered, the control get resized to the proper size. Everything goes well but the problem still remains when the user maximizes the Form and then Restores it. In that case the ResizeBegin event isn't triggered and the control does not resize to widht=1, height=1. So what I want is to resize the control to widht=1, height=1 before the Form gets resized when the user Restores the Forms size but I didn't find any event that will do this job. My problem could be solved by overloading a method that is called when the user wants to Restore the Form's size but I didn't find any to do this.

    Thanks for any suggestions!

    Regards.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Does that control not have the Anchor property?

    Comment

    • Funky
      New Member
      • Mar 2008
      • 13

      #3
      Unfortunately no. It's a part of a third-party library.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Hmm so that thirdparty is wrapping some native win32 components and they're not managed controls?

        Comment

        • Funky
          New Member
          • Mar 2008
          • 13

          #5
          I'm using the toolStripEx control from the Syncfusion Essential Studio. I wrote them about docking for this control, they said that it has not implemented. Maybe It'll be in the future :).

          I'm searching for a work-around. I could fire a trigger befor the form gets Resized or to overload/re-implement a method that Resizes the Form but don't know how could be this reachable :\.

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            You can try checking WindowState (minimized/maximized/etc) and see if this helps?

            What features does toolStripEx offer over the .NET toolstrip?

            Comment

            • Funky
              New Member
              • Mar 2008
              • 13

              #7
              Actually it has docking option but it doesn't work.

              I tried with maximized state but it is not helpful to check it. I just have to catch the moment before the Form gets restored.

              I searched the functionality of the control (it's called toolStripEx) for any property that would not let the control to collapse if the parent container gets smaller than the control itself.

              :\ damnit

              Comment

              Working...