NX Screen button for window

Source: Internet
Author: User

sometimes when activating a command button, you need to disable the stop another or more command buttons

    " " <summary>    " "button is sensitive" " </summary>    " " <param name= "Btnname" >button Name</param>    " " <returns><c>true</c>if sensitive (not masked),<c>false</c>otherwise.</returns>     Public FunctionGetmenubuttonsensitivity (ByValBtnname as String) as Boolean        DimMenubtn asNXOpen.MenuBar.MenuButton =NXOpen.UI.GetUI (). Menubarmanager.getbuttonfromname (Btnname)IfMenubtnIsNot  Nothing  Then            ReturnMenubtn.buttonsensitivity =MenuButton.SensitivityStatus.SensitiveEnd If        Return False    End Function    " " <summary>    " "Set button sensitive state" " </summary>    " " <param name= "Btnname" >button Name</param>    " " <param name= "issensitivity" >sensitive (not shielded)</param>     Public SubSetmenubuttonsensitivity (ByValBtnname as String,ByValIssensitivity as Boolean)        DimMenubtn asNXOpen.MenuBar.MenuButton =NXOpen.UI.GetUI (). Menubarmanager.getbuttonfromname (Btnname)IfMenubtnIsNot  Nothing  Thenmenubtn.buttonsensitivity=If(issensitivity, MenuButton.SensitivityStatus.Sensitive, MenuButton.SensitivityStatus.Insensitive)End If    End Sub    " " <summary>    " "Take NX lock status" " </summary>    " " <returns><c>true</c>if locked (all buttons are blocked),<c>false</c>otherwise.</returns>     Public FunctionGetnxlockstatus () as Boolean        ReturnNXOpen.UI.GetUI (). Asklockstatus () =NXOpen.UI.Status.LockEnd Function    " " <summary>    " "Set NX lock status" " </summary>    " " <param name= "Islock" >if locked (all buttons are masked), set to<c>true</c> .</param>     Public SubSetnxlockstatus (ByValIslock as Boolean)        IfIslock ThenNXOpen.UI.GetUI (). Lockaccess ()ElseNXOpen.UI.GetUI (). Unlockaccess ()End If    End Sub
VB. NET code

/// <summary>///button is sensitive/// </summary>/// <param name= "Btnname" >button Name</param>/// <returns><c>true</c>if sensitive (not masked),<c>false</c>otherwise.</returns> Public BOOLGetmenubuttonsensitivity (stringbtnname) {NXOpen.MenuBar.MenuButton menubtn=NXOpen.UI.GetUI ().        Menubarmanager.getbuttonfromname (Btnname); if(Menubtn! =NULL) {                returnMenubtn.buttonsensitivity = =MenuButton.SensitivityStatus.Sensitive; }        return false;}/// <summary>///Set button sensitive state/// </summary>/// <param name= "Btnname" >button Name</param>/// <param name= "issensitivity" >sensitive (not shielded)</param> Public voidSetmenubuttonsensitivity (stringBtnname,BOOLissensitivity) {NXOpen.MenuBar.MenuButton menubtn=NXOpen.UI.GetUI ().        Menubarmanager.getbuttonfromname (Btnname); if(Menubtn! =NULL) {menubtn.buttonsensitivity= issensitivity?MenuButton.SensitivityStatus.Sensitive:MenuButton.SensitivityStatus.Insensitive; }}/// <summary>///Take NX lock status/// </summary>/// <returns><c>true</c>if locked (all buttons are blocked),<c>false</c>otherwise.</returns> Public BOOLGetnxlockstatus () {returnNXOpen.UI.GetUI (). Asklockstatus () = =NXOpen.UI.Status.Lock;}/// <summary>///Set NX lock status/// </summary>/// <param name= "Islock" >if locked (all buttons are masked), set to<c>true</c> .</param> Public voidSetnxlockstatus (BOOLIslock) {        if(Islock) {NXOpen.UI.GetUI ().        Lockaccess (); } Else{NXOpen.UI.GetUI ().        Unlockaccess (); }}
C # code

NX Screen button for window

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.