Microsoft Developer Network > 포럼 홈 > Visual C++ General > Limit Minimum size of CDockablePane
질문하기질문하기
 

답변됨Limit Minimum size of CDockablePane

  • 2009년 6월 29일 월요일 오전 11:01Harsh Shankar 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    Hi guys,
    I am working on MDI VS-2008 aplication's Dockable pane and have to limit the minimum height and width of the pane.

    For that, i tried to prevent it to CDockablepane::onsize() function's call in the OnSize function and to also overrided ON_WM_GETMINMAXINFO message.

    but it didn't worked :(

    Please help.
    Regards
    Harsh Shankar

답변

  • 2009년 7월 3일 금요일 오전 8:57Wesley YaoMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨코드 있음
    Well, when we dock a pane to another one, framework will generate a CTabbedPane which is the container for them, we will also need SetMinSize() for it.  The function to create this CTabbedPane is "CreateTabbedPane()", you could try to override it and SetMinSize() in it, i.e.:

    CTabbedPane* MyDockablePane::CreateTabbedPane()
    {
        CTabbedPane* pTabbedBar = CDockablePane::CreateTabbedPane();
        pTabbedBar->SetMinSize(CSize(200, 200)); //Here is that
    
        return pTabbedBar;
    }
    

    Note: But we cannot modify the default CDockablePane's method, so when we dock a derived pane to a "native CDockablePane", it will still act the result you've seen.

    Sincerely,
    Wesley
    Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • 답변으로 표시됨Harsh Shankar 2009년 7월 3일 금요일 오전 9:04
    •  

모든 응답

  • 2009년 7월 1일 수요일 오전 10:44Wesley YaoMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    Hi Harsh,

    We could use CDockablePane::SetMinSize() method to limit the minimize size of the CDockablePane, i.e.: SetMinSize(CSize(100, 100)).

    Sincerely,
    Wesley
    Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • 답변으로 표시 취소됨Harsh Shankar 2009년 7월 3일 금요일 오전 7:03
    • 답변으로 표시됨Harsh Shankar 2009년 7월 2일 목요일 오후 4:28
    •  
  • 2009년 7월 2일 목요일 오후 4:35Harsh Shankar 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    Hi Wesley,
    Thanks for replying.
    Sorry, but I already had tried it. but i don't know why it didn't worked.
    As i was trying your answer of my one other post, i got it working.

    Thanks again


    Regards
    Harsh
    VC++ Developer

  • 2009년 7월 3일 금요일 오전 5:07Wesley YaoMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    Hi Harsh,

    Is it still does not work?  In my another post to your question, it's a work way.
    Maybe you have to delete the registry setting for it: search the name of your solution, delete its setting key.

    Sincerely,
    Wesley
    Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
  • 2009년 7월 3일 금요일 오전 6:46Harsh Shankar 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    Hi Wesley,
    I think one of my posts are missed that i posted just after reading your's other post and trying that..
    well, yes it worked but partially :(
    as i set the minimum size, it prevents from the resizing it to go less than the said but the problem i incountered is when some other Dockable pane is tabbed with it. even it is the active one but the minimum size have no limit

    as snap of cade, you can your own code, since i have used the same.

    thanks


    Regards Harsh VC++ Developer
  • 2009년 7월 3일 금요일 오전 8:57Wesley YaoMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨코드 있음
    Well, when we dock a pane to another one, framework will generate a CTabbedPane which is the container for them, we will also need SetMinSize() for it.  The function to create this CTabbedPane is "CreateTabbedPane()", you could try to override it and SetMinSize() in it, i.e.:

    CTabbedPane* MyDockablePane::CreateTabbedPane()
    {
        CTabbedPane* pTabbedBar = CDockablePane::CreateTabbedPane();
        pTabbedBar->SetMinSize(CSize(200, 200)); //Here is that
    
        return pTabbedBar;
    }
    

    Note: But we cannot modify the default CDockablePane's method, so when we dock a derived pane to a "native CDockablePane", it will still act the result you've seen.

    Sincerely,
    Wesley
    Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • 답변으로 표시됨Harsh Shankar 2009년 7월 3일 금요일 오전 9:04
    •