• Using X++ code Hided to Main Content Panel Frame


    Wrote by Jimmy on DEC 28th 2010

    1) active show or hide ContentPane

    static void Jimmy_HideMainFramePanel(Args _args)
    {
    /*
    For developers the ‘Content Pane’ can contribute to a great deal of frustration.
    Specially for does who are used to develope in AX 4 or earlier.
    Here is a small job that will hide it for you:
    */
        #WinAPI
        ;
    
        WinApi::showWindow(
            WinApi::findWindowEx(
                WinApi::findWindowEx(
                    WinApi::findWindow('AxMainFrame', ''),
                        0, 'MDIClient', ''),
                            0, 'ContentFrame', ''), #SW_SHOW);//SW_HIDE
    //Replace #SW_HIDE with #SW_SHOW to show it again.
    }
    

    2) forever disable to be ContentPane

    static void Jimmy_hideAnnoyingContentPane(Args _args)
    {
        HWND contentPane =  WinApi::findWindowEx(WinAPI::findWindowEx(infolog.hWnd(), 0, 'MDIClient', ''),
                            0,
                            'ContentFrame',
                            ''
                            );
    ;
        print contentPane;
        if (contentPane)
        {
            //WinApi::ShowWindow(contentPane, #SW_HIDE); //#SW_SHOW //#SW_HIDE
            WinApi::destroyWindow(contentPane);//forever disable to be ContentPane
        }
        pause;
    }
    

    3)selection status on the dialog

    static void Jimmy_ContentPaneSelectionStatus(Args _args)
    {
        Dialog          Dialog      = new Dialog("Destroy Content Pane Window");
        DialogField     dlgHide     = Dialog.addField(typeid(Noyes),"Hide Content Pane Window");
        DialogField     dlgShow     = Dialog.addField(typeid(Noyes),"Show Content Pane Window");
        DialogField     dlgDestroy  = Dialog.addField(typeid(Noyes),"Destroy Content Pane Window");
        hWnd            hWnd;
        HWND            contentPane;
        #WinApi
    ;
        Dialog.doInit();
        dlgDestroy.value(1);
        if(!Dialog.run())
            return ;
        if(dlgHide.value() && dlgShow.value() && dlgDestroy.value())
            throw error("Please choose one of checkbox!");
    
        contentPane =  WinApi::findWindowEx(WinAPI::findWindowEx(infolog.hWnd(), 0, 'MDIClient', ''),0,'ContentFrame','' );
        if (contentPane)
        {
            if(dlgHide.value())
                WinApi::ShowWindow(contentPane, #SW_HIDE); //#SW_SHOW //#SW_HIDE
            if(dlgShow.value())
                WinApi::ShowWindow(contentPane, #SW_SHOW); //#SW_SHOW //#SW_HIDE
            if(dlgDestroy.value())
                WinApi::destroyWindow(contentPane);//forever disable to be ContentPane
        }
    
    }
    

  • 相关阅读:
    2019牛客暑期多校训练营(第二场)
    2019牛客暑期多校训练营(第一场)
    JOISC2014 挂饰("01"背包)
    UPC 2019年第二阶段我要变强个人训练赛第十六场
    UPC个人训练赛第十五场(AtCoder Grand Contest 031)
    Wannafly挑战赛15 C“出队”(约瑟夫环类问题)
    UVA 133“The Dole Queue”(循环报数处理技巧)
    洛谷P1169 [ZJOI2007]棋盘制作 悬线法 动态规划
    洛谷P1273 有线电视网 树上分组背包DP
    CF1097D Makoto and a Blackboard 质因数分解 DP
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1918248.html
Copyright © 2020-2023  润新知