{"id":17068,"date":"2017-12-01T12:40:45","date_gmt":"2017-12-01T12:40:45","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?p=17068"},"modified":"2024-03-20T04:56:40","modified_gmt":"2024-03-20T04:56:40","slug":"sage-300-allowing-only-minimize-box-on-customized-ocx","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/","title":{"rendered":"Sage 300 -Allowing Only Minimize Box on Customized OCX"},"content":{"rendered":"<p style=\"text-align: justify;\">Sage 300 classic desktop provides various user interfaces i.e. screens which are basically OCX files i.e. \u201cActiveX Control Objects\u201d. The entry screens generally has windows maximize and minimize buttons but for Report user interfaces or those user interfaces on which no tabular data or grid present the maximize button might been disabled. While customizing these Sage 300 user interfaces on which maximize button is disabled, developers may face the difficulty to achieve the same effect on customized OCX. In this blog we are going to discuss simple code changes to be done in the standard code to achieve the same.<\/p>\n<p style=\"text-align: justify;\"><b>New Stuff:<\/b> <a title=\"Permalink to Migrate AP Payments from Sage Pro to Sage 300 ERP\" href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/migrate-ap-payments-from-sage-pro-to-sage-300-erp\/\" target=\"_blank\" rel=\"bookmark noopener\">Migrate AP Payments from Sage Pro to Sage 300 ERP<\/a><\/p>\n<p style=\"text-align: justify;\">The visibility of maximize and minimize buttons for the Accpac user interface container\u2019s is depend on the global declarations done while creating any OCX i.e. depend on the value (True \/ False) set for the \u201cACCPACUIResizable\u201d Property.<\/p>\n<p>If this has been set to \u201cTrue\u201d then both Minimize and Maximize buttons are visible and if it is set as \u201cFalse\u201d both Maximize and Minimize buttons will not appear.<br \/>\nTo make only Minimize button visible on Accpac UI below code changes can be done:<\/p>\n<ol>\n<li>In the module \u201cACCPACUIGlobals\u201d in general declarations set the \u201cACCPACUIResizable\u201d property to false.<\/li>\n<\/ol>\n<p>\u201cPublic Const ACCPACUIResizable As Boolean = False\u201d<br \/>\n2. In the user control code in \u201cSaveUISize()\u201d subroutine make the changes enclosed under <b>\u201c&#8217;B-GT\u2026 \u2018E-GT\u2019\u201d below<\/b><br \/>\n<b>Private Sub SaveUISize()<\/b><br \/>\nOn Error Resume Next<br \/>\nDim lParentHwnd As Long<br \/>\nDim bMaximized As Boolean<br \/>\nDim bMinimized As Boolean<br \/>\n&#8216; Find the top-level parent window (doesn&#8217;t\u00a0&#8216; include owner, i.e. caller, windows).<br \/>\nlParentHwnd = GetAncestor(UserControl.hWnd, _GA_ROOT)<br \/>\nIf Err.Number = 0 Then<br \/>\n<b>&#8216;B-GT-Commented code line and added code for maximizing button disabling<\/b><br \/>\n&#8216;bMaximized = CBool(IsZoomed(lParentHwnd))<br \/>\nbMaximized = False<br \/>\n<b>&#8216;E-GT-Commented code line and added code for maximizing button disabling<\/b><br \/>\nbMinimized = CBool(IsIconic(lParentHwnd))<br \/>\nElse<br \/>\n&#8216; The parent doesn&#8217;t have an Hwnd, so assume<br \/>\n&#8216; it is not maximized or minimized.<br \/>\nbMaximized = False<br \/>\n<b>&#8216;B-GT-Commented code line and added code for maximizing button disabling<\/b><br \/>\n&#8216;bMinimized = False<br \/>\nbMinimized = True<br \/>\n<b>&#8216;E-GT-Commented code line and added code for maximizing button disabling<\/b><br \/>\nErr.Clear &#8216; this error is now handled<br \/>\nEnd If<br \/>\nIf (bMaximized = True) Or (bMinimized = True) Then<br \/>\n&#8216; GET OUT! DON&#8217;T save the size, but DON&#8217;T<br \/>\n&#8216; clear the previous saved size either!<br \/>\nErr.Clear<br \/>\nExit Sub<br \/>\nEnd If<br \/>\n&#8216; IF WE GOT TO HERE, WE NEED TO DEAL WITH THE<br \/>\n&#8216; ACCPAC PROPERTIES.<br \/>\nWith mSession.GetAccpacProperty<br \/>\n.menuID = ACCPACProgramName<br \/>\n.objectID = ACCPACProgramName<br \/>\n&#8216; See if we need to save\/clear the height.<br \/>\n.keyword = UIHEIGHT_KEY<br \/>\nIf ScaleHeight &lt;= msMinHeight Then<br \/>\n.PropClear<br \/>\nElse<br \/>\nDim strUIHeight As String<br \/>\nstrUIHeight = CStr(ScaleHeight)<br \/>\n.PropPut CVar(strUIHeight), Len(strUIHeight)<br \/>\nEnd If<br \/>\n&#8216; See if we need to clear\/save the width.<br \/>\n.keyword = UIWIDTH_KEY<br \/>\nIf ScaleWidth &lt;= msMinWidth Then<br \/>\n.PropClear<br \/>\nElse<br \/>\nDim strUIWidth As String<br \/>\nstrUIWidth = CStr(ScaleWidth)<br \/>\n.PropPut CVar(strUIWidth), Len(strUIWidth)<br \/>\nEnd If<br \/>\nEnd With &#8216; mSession.GetAccpacProperty<br \/>\nErr.Clear<br \/>\n<b>End Sub<\/b><br \/>\nThe above changes will allow us to get the OCX user interface with only minimize and close button. Kindly refer to below customized user interface for the reference:<br \/>\n<a href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2017\/12\/OCXMaximizeButtonDisabling-1.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-17104\" src=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2017\/12\/OCXMaximizeButtonDisabling-1.jpg\" alt=\"\" width=\"492\" height=\"353\" \/><\/a><br \/>\nAs you can see in the screenshot above the \u201cMaximized\u201d button is disabled for the customized OCX.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sage 300 classic desktop provides various user interfaces i.e. screens which are basically OCX files i.e. \u201cActiveX Control Objects\u201d. The entry screens generally has windows maximize and minimize buttons but for Report user interfaces or those user interfaces on which no tabular data or grid present the maximize button might been disabled. While customizing these\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[79,675,1763,2357],"class_list":["post-17068","post","type-post","status-publish","format-standard","hentry","category-sage-accpac","tag-accpac","tag-customization","tag-ocx","tag-sage-300-erp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Sage 300 allows only the Minimize Box on customized OCX.<\/title>\n<meta name=\"description\" content=\"Sage 300 classic desktop offers a variety of user interfaces, or screens, which are essentially OCX files, or &quot;ActiveX Control Objects&quot;.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sage 300 allows only the Minimize Box on customized OCX.\" \/>\n<meta property=\"og:description\" content=\"Sage 300 classic desktop offers a variety of user interfaces, or screens, which are essentially OCX files, or &quot;ActiveX Control Objects&quot;.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/\" \/>\n<meta property=\"og:site_name\" content=\"Sage 300 ERP \u2013 Tips, Tricks and Components\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-01T12:40:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-20T04:56:40+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2017\/12\/OCXMaximizeButtonDisabling-1.jpg\" \/>\n<meta name=\"author\" content=\"sage300\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"sage300\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/\",\"name\":\"Sage 300 allows only the Minimize Box on customized OCX.\",\"isPartOf\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2017\/12\/OCXMaximizeButtonDisabling-1.jpg\",\"datePublished\":\"2017-12-01T12:40:45+00:00\",\"dateModified\":\"2024-03-20T04:56:40+00:00\",\"author\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5\"},\"description\":\"Sage 300 classic desktop offers a variety of user interfaces, or screens, which are essentially OCX files, or \\\"ActiveX Control Objects\\\".\",\"breadcrumb\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/#primaryimage\",\"url\":\"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2017\/12\/OCXMaximizeButtonDisabling-1.jpg\",\"contentUrl\":\"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2017\/12\/OCXMaximizeButtonDisabling-1.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sage 300 -Allowing Only Minimize Box on Customized OCX\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/\",\"name\":\"Sage 300 ERP \u2013 Tips, Tricks and Components\",\"description\":\"Explore the world of Sage 300 with our insightful blogs, expert tips, and the latest updates. We\u2019ll empower you to leverage Sage 300 to its fullest potential. As your one-stop partner, Greytrix delivers exceptional solutions and integrations for Sage 300. Our blogs extend our support to businesses, covering the latest insights and trends. Dive in and transform your Sage 300 experience with us! \",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5\",\"name\":\"sage300\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g\",\"caption\":\"sage300\"},\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/author\/sageaccpac\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Sage 300 allows only the Minimize Box on customized OCX.","description":"Sage 300 classic desktop offers a variety of user interfaces, or screens, which are essentially OCX files, or \"ActiveX Control Objects\".","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/","og_locale":"en_US","og_type":"article","og_title":"Sage 300 allows only the Minimize Box on customized OCX.","og_description":"Sage 300 classic desktop offers a variety of user interfaces, or screens, which are essentially OCX files, or \"ActiveX Control Objects\".","og_url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/","og_site_name":"Sage 300 ERP \u2013 Tips, Tricks and Components","article_published_time":"2017-12-01T12:40:45+00:00","article_modified_time":"2024-03-20T04:56:40+00:00","og_image":[{"url":"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2017\/12\/OCXMaximizeButtonDisabling-1.jpg","type":"","width":"","height":""}],"author":"sage300","twitter_card":"summary_large_image","twitter_misc":{"Written by":"sage300","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/","url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/","name":"Sage 300 allows only the Minimize Box on customized OCX.","isPartOf":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/#primaryimage"},"image":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/#primaryimage"},"thumbnailUrl":"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2017\/12\/OCXMaximizeButtonDisabling-1.jpg","datePublished":"2017-12-01T12:40:45+00:00","dateModified":"2024-03-20T04:56:40+00:00","author":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5"},"description":"Sage 300 classic desktop offers a variety of user interfaces, or screens, which are essentially OCX files, or \"ActiveX Control Objects\".","breadcrumb":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/#primaryimage","url":"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2017\/12\/OCXMaximizeButtonDisabling-1.jpg","contentUrl":"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2017\/12\/OCXMaximizeButtonDisabling-1.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2017\/12\/01\/sage-300-allowing-only-minimize-box-on-customized-ocx\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/"},{"@type":"ListItem","position":2,"name":"Sage 300 -Allowing Only Minimize Box on Customized OCX"}]},{"@type":"WebSite","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website","url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/","name":"Sage 300 ERP \u2013 Tips, Tricks and Components","description":"Explore the world of Sage 300 with our insightful blogs, expert tips, and the latest updates. We\u2019ll empower you to leverage Sage 300 to its fullest potential. As your one-stop partner, Greytrix delivers exceptional solutions and integrations for Sage 300. Our blogs extend our support to businesses, covering the latest insights and trends. Dive in and transform your Sage 300 experience with us! ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5","name":"sage300","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g","caption":"sage300"},"url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/author\/sageaccpac\/"}]}},"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/17068","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/comments?post=17068"}],"version-history":[{"count":1,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/17068\/revisions"}],"predecessor-version":[{"id":33931,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/17068\/revisions\/33931"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/media?parent=17068"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/categories?post=17068"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/tags?post=17068"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}