Print Page | Close Window

Hide/disable Form ControlBox button

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=16928
Printed Date: 23 November 2024 at 4:23pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Hide/disable Form ControlBox button
Posted By: Squale
Subject: Hide/disable Form ControlBox button
Date Posted: 08 July 2010 at 9:19am
Is it possible to hide or disable form controlbox button at runtime?
In my VB6 application, resize is not supported, therefore I have disabled MaxButton. I would have prefered make it not display.
For modal form I would like to hide minimize and maximize button.


-------------
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0



Replies:
Posted By: Xander75
Date Posted: 18 August 2010 at 4:43am
Hi,

This has nothing to do with the Codejock software, what you are requesting is specific to VB6.

You do one of two things...

  1. Set the ControlBox property on the Form to False, this removes all buttons including the Form Icon leaving only the caption.
  2. Or set the BorderStyle to 1 - Fixed Style, this removes both the minimize and maximize buttons.
Next time use Google!


-------------
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)


Posted By: Squale
Date Posted: 18 August 2010 at 5:03am
thanks xander for your answer but... Google can not help (you must be a fan of "Let me google that for you" http://www.lmgtfy.com/?q=Boulet&l=1)

My question is to know if we can "play" with commandbar controlbox. Hiding "maximize" button and having "miminize" and "close" one re-arrange. Why not, a way to add new button next to controlbox one.

CommandBar "SetFlags" seems to be THE solution but I have not found a way to make it works.


-------------
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows XP (32bit) - SP 3
Language: Visual Basic 6.0


Posted By: Xander75
Date Posted: 18 August 2010 at 6:13am
Hi,

As far as I know the ControlBox of a Form is skinned by the Codejock tool and that's all, as the Form is still a VB Form underneath.

Using the "CommandBars.ActiveMenuBar.SetFlags" option only removes the selected box from the CommandBars when used with a MDI application, not the Form.



To do this use the following code:


    CommandBars.ActiveMenuBar.SetFlags xtpFlagHideMaximizeBox, 1

But as far as I can see it does not change the Forms actual ControlBox area.



-------------
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net