StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



disable/hide close button...Expand / Collapse
Author
Message
Posted 09/14/2006 2:09:49 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
How do i disable or hide the close button on a windows form? I dont want to hide the minimize and maximize buttons... i want them to stay.

Thanks
Post #2824
Posted 09/14/2006 4:07:40 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 12:47:23 AM
Posts: 4,556, Visits: 4,543
You can't through the standard .NET form designer.  You will have to use a Windows API and hand off the window handle on the form load to hide only the close button   Sorry.
Post #2825
Posted 09/15/2006 6:45:02 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
No problem. Thanks for the info. Instead I have a messagebox pop up asking them if they really want to exit. 
Post #2831
Posted 09/20/2006 7:47:38 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Today @ 7:41:48 AM
Posts: 359, Visits: 2,309
Mike,

You can disable the close button on a form by overriding the createparams property.

Paul

Protected Overrides ReadOnly Property CreateParams() As CreateParams

Get

Dim ClsCp As CreateParams = MyBase.CreateParams

Const CS_NOCLOSE As Integer = &H200

ClsCp.ClassStyle = ClsCp.ClassStyle Or CS_NOCLOSE

Return ClsCp

End Get

End Property

Post #2943
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 8:45am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 12 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.