DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   Remove the "x" in the window at runtime (http://www.daniweb.com/forums/thread157257.html)

MichaelSammels Nov 14th, 2008 3:41 am
Remove the "x" in the window at runtime
 
Hello,

This is my first post on DaniWeb, so I hope I did it OK.

Anyway, you'll notice that in the top of every window you have standard close button (the x in the red box).

I was wondering if it was possible to remove at this runtime, using VB6, so all I can see is the title bar?

Thanks

QVeen72 Nov 14th, 2008 4:43 am
Re: Remove the "x" in the window at runtime
 
Hi,

Set this property for the form :
ControlBox = False

Regards
Veena

squidd Nov 16th, 2008 1:51 am
Re: Remove the "x" in the window at runtime
 
What Veena said will work just fine, but you could also completely remove the entire border including the X at runtime by simply going to the BorderStyle property when your form is chosen and setting it to 0-None. This would also achieve the same result and then some...

Good luck.

MichaelSammels Nov 16th, 2008 3:15 pm
Re: Remove the "x" in the window at runtime
 
Ah yes - that is a very good idea, except I needed a border.

Out of interest, is it possible to set this style using code at runtime?

jbennet Nov 16th, 2008 4:56 pm
Re: Remove the "x" in the window at runtime
 
Yes. Just set Form1.controlbox = false


All times are GMT -4. The time now is 4:33 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC