By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,852 Members | 2,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,852 IT Pros & Developers. It's quick & easy.

close icon disable

P: n/a
Hi,

I would like to disable the close icon on the
form which will be available at the right most corner of
the form in VB.NET which property i have to set.

Regards,
Krishna.
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Krishna,

Although it is easy to do, will disabling the close button probably mean
that your users will call this a bug.

In my opinion is better to set the controlbox to false.

I hope this helps?

Cor

"krishna" <ve*************@gmail.com>
Hi,

I would like to disable the close icon on the
form which will be available at the right most corner of
the form in VB.NET which property i have to set.

Regards,
Krishna.

Nov 21 '05 #2

P: n/a
"krishna" <ve*************@gmail.com> schrieb:
I would like to disable the close icon on the
form which will be available at the right most corner of
the form in VB.NET which property i have to set.


<URL:http://dotnet.mvps.org/dotnet/code/windowsandforms/>
-> "Entfernen der "Schliessen"-Systemschaltfläche eines Formulars"

Ignore the text and take a look at the code...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3

P: n/a
Put this anywhere in the form.

Protected Overrides ReadOnly Property CreateParams() As CreateParams

Get

Dim cp As CreateParams = MyBase.CreateParams

Const CS_DBLCLKS As Int32 = &H8

Const CS_NOCLOSE As Int32 = &H200

cp.ClassStyle = CS_DBLCLKS Or CS_NOCLOSE

Return cp

End Get

End Property
"krishna" <ve*************@gmail.com> wrote in message
news:0e****************************@phx.gbl...
Hi,

I would like to disable the close icon on the
form which will be available at the right most corner of
the form in VB.NET which property i have to set.

Regards,
Krishna.

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.