PC Review


Reply
Thread Tools Rate Thread

Close button on a form in VB.Net 2003

 
 
=?Utf-8?B?R3JlZw==?=
Guest
Posts: n/a
 
      23rd Mar 2005
Is there anyway to remove the close button on a form, or is there a "On
Close" property? TIA.
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      23rd Mar 2005
"Greg" <(E-Mail Removed)> schrieb:
> Is there anyway to remove the close button on a form, or is there a "On
> Close" property? TIA.


To remove the control box, set the form's 'ControlBox' property to 'False'.

Add a handler to the form's 'Closing' event if you want to be notified when
the form closes. You can set 'e.Cancel = False' there to prevent the form
from closing.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      24th Mar 2005
Greg,

I find it awful to do things that are in conflict what is beside the normal
habit from users (the same as a car without a steering wheel but a
joystick), however this solution from Mick looks acceptable for me.

\\\by Mick Doherty
Protected Overrides ReadOnly _
Property CreateParams() As CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
Const CS_NOCLOSE As Integer = &H200
cp.ClassStyle = cp.ClassStyle Or CS_NOCLOSE
Return cp
End Get
End Property
///

I hope this helps a little bit?

Cor


 
Reply With Quote
 
=?Utf-8?B?R3JlZw==?=
Guest
Posts: n/a
 
      24th Mar 2005
Thanks for your help. Your sugestion solved my problem.
"Greg" wrote:

> Is there anyway to remove the close button on a form, or is there a "On
> Close" property? TIA.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
button to open form export to Excel and close form deb Microsoft Access Forms 1 25th Jun 2008 02:27 PM
Have to click "Close" button three times to close dialog form Michael Fuchs Microsoft Access Form Coding 0 6th Aug 2006 11:37 AM
Close button on a form will not close form - error 2585 - action cannot be carried out while processing a form Angus Comber Microsoft Access 2 19th Jul 2006 12:21 PM
Command Button Open form / Close form =?Utf-8?B?cGRiZXJnZXI=?= Microsoft Access Forms 1 15th Feb 2006 06:21 PM
Button To open new form does not close the main form Veli Izzet Microsoft Access 7 25th Jul 2005 01:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:36 PM.