473,322 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Control Box Question

Rob
Maybe I am missing something...

By setting the ControlBox Property to True, you allow the Control Box to
appear on the form...

If the ControlBox property is set to True, setting the MaximizeBox to False
will disable the Maximize property within the Control box (same goes for
Minimize Box).

Where is the property to disable the "CloseBox" ?

Is there a way to show the ControlBox, but disable the CloseBox ?


Jun 27 '08 #1
2 1359
On May 30, 1:57 pm, "Rob" <ro...@yahoo.comwrote:
Maybe I am missing something...

By setting the ControlBox Property to True, you allow the Control Box to
appear on the form...

If the ControlBox property is set to True, setting the MaximizeBox to False
will disable the Maximize property within the Control box (same goes for
Minimize Box).

Where is the property to disable the "CloseBox" ?

Is there a way to show the ControlBox, but disable the CloseBox ?
Hi Rob,
I've adapted the following code to VB.NET from this article:
http://www.codeproject.com/KB/cs/DisableClose.aspx

And here is the VB.NET one:
(Put the code just after "Public Class Form1")

Public Class Form1

Private Const CP_NOCLOSE_BUTTON As Integer = 512

Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
Get
Dim noclose As CreateParams
noclose = MyBase.CreateParams
noclose.ClassStyle = CP_NOCLOSE_BUTTON
Return noclose
End Get
End Property

' Codes...

End Class

..and works.

Hope this helps,

Onur Güzel
Jun 27 '08 #2
"Rob" <ro***@yahoo.comschrieb:
Is there a way to show the ControlBox, but disable the CloseBox ?
Take a look at these code samples:

<URL:http://dotnet.mvps.org/dotnet/code/forms/#NoClose>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: news.microsoft.com | last post by:
I have a user control with four option buttons depending which option button is pressed I store a score into session object. On the load event of a control the session object is set to 0. There is...
4
by: Marius Trælnes | last post by:
Hello! I am about to make a class/control that creates tabbing functionality. The result is in HTML/CSS/JavaScript output. My question is: Within the tabs I want to simply add user controls...
1
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
5
by: Richard Brown | last post by:
Ok, I've been looking through the .NET SDK docs and stuff. I'm wondering if you can provide a control extender that does generic validation or functionality just by dropping it on the form. For...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
1
by: Mark Olbert | last post by:
I have a "master" composite control which, in turn, holds an instance of a "detail" composite control (the "master" control will ultimately contain multiple instances of the "detail" control, but...
3
by: Hamed | last post by:
Hello Is it possible to get a control (e.g. a checkbox) and make a Graphics object or a Bitmap object of current face of the control? I want to implement Sparse property for a ColumnStyle so I...
15
by: Hamed | last post by:
Have I posted the message to wrong newsgroup? Or Does the question is so much strage? Would someone please kindly direct me to a true newsgroup or resource? Best Regards Hamed
1
by: Alec MacLean | last post by:
Hi, Outline of problem: I've built a set of user controls that are used to output questions for a survey and gather the responses using simple radio buttons. I'm adding an optional textbox...
2
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.