Click here to Skip to main content
15,889,216 members
Home / Discussions / C#
   

C#

 
QuestionArrayList with restricted access Pin
Mark T.11-Feb-07 4:11
Mark T.11-Feb-07 4:11 
AnswerRe: ArrayList with restricted access Pin
Stefan Troschuetz11-Feb-07 4:30
Stefan Troschuetz11-Feb-07 4:30 
AnswerRe: ArrayList with restricted access Pin
Luc Pattyn11-Feb-07 5:43
sitebuilderLuc Pattyn11-Feb-07 5:43 
GeneralRe: ArrayList with restricted access Pin
Mark T.11-Feb-07 10:51
Mark T.11-Feb-07 10:51 
AnswerRe: ArrayList with restricted access Pin
Syed Muhammad Kamran12-Feb-07 2:02
Syed Muhammad Kamran12-Feb-07 2:02 
QuestionDisabling Windows Buttons: Minimize,Restore,Close Pin
Blekk11-Feb-07 4:06
Blekk11-Feb-07 4:06 
AnswerRe: Disabling Windows Buttons: Minimize,Restore,Close Pin
Stefan Troschuetz11-Feb-07 4:24
Stefan Troschuetz11-Feb-07 4:24 
AnswerRe: Disabling Windows Buttons: Minimize,Restore,Close [modified] Pin
sharpiesharpie11-Feb-07 4:29
sharpiesharpie11-Feb-07 4:29 
About the button, instead of the Close function, try using the Application.Exit function, the Close one seems to not work in many occasions.

And for the x button, i thought this might be a good think to know myself, and i made some research and this is what i came up with:

there's an event in frameworks 1.1 which is called Closing (which later became FormClosing in frameworks 2), so you use the event (this.FormClosing +=...) and in the event you can use:
e.Cancel = true;
this also stops it from closing with the F4 key, so you can do like so:

first, define the event:
<br />
this.FormClosing += new FormClosingEventHandler(MyForm_FormClosing);<br />

and then in the event do something like this:
<br />
        void MyForm_FormClosing(object sender, FormClosingEventArgs e)<br />
        {<br />
            DialogResult a = MessageBox.Show("Are you sure you want to close the program?","Cancel",MessageBoxButtons.YesNo);<br />
            if (a == DialogResult.No)<br />
                e.Cancel = true;<br />
        }<br />


And as for canceling the minimize and maximize buttons? how about just disabling them? or just use the Form.Resize event.

hope it helps.


-- modified at 10:35 Sunday 11th February, 2007
GeneralRe: Disabling Windows Buttons: Minimize,Restore,Close Pin
Blekk11-Feb-07 6:14
Blekk11-Feb-07 6:14 
GeneralRe: Disabling Windows Buttons: Minimize,Restore,Close Pin
Blekk11-Feb-07 6:24
Blekk11-Feb-07 6:24 
GeneralRe: Disabling Windows Buttons: Minimize,Restore,Close Pin
sharpiesharpie11-Feb-07 6:56
sharpiesharpie11-Feb-07 6:56 
QuestionDisplaying a message when closing Pin
Blekk11-Feb-07 3:22
Blekk11-Feb-07 3:22 
AnswerRe: Displaying a message when closing Pin
cellardoor071611-Feb-07 3:46
cellardoor071611-Feb-07 3:46 
GeneralRe: Displaying a message when closing Pin
Blekk11-Feb-07 3:56
Blekk11-Feb-07 3:56 
QuestionIsNumeric Pin
IgorMI511-Feb-07 3:21
IgorMI511-Feb-07 3:21 
AnswerRe: IsNumeric Pin
Stefan Troschuetz11-Feb-07 4:35
Stefan Troschuetz11-Feb-07 4:35 
AnswerRe: IsNumeric Pin
ali_reza_zareian11-Feb-07 10:12
ali_reza_zareian11-Feb-07 10:12 
AnswerRe: IsNumeric Pin
Tim Paaschen11-Feb-07 20:47
Tim Paaschen11-Feb-07 20:47 
QuestionHow to change ms access column name in c# Pin
Neuromancer_11-Feb-07 3:19
Neuromancer_11-Feb-07 3:19 
QuestionIdentifying file type Pin
dream catcher11-Feb-07 1:26
dream catcher11-Feb-07 1:26 
AnswerRe: Identifying file type Pin
sharpiesharpie11-Feb-07 4:50
sharpiesharpie11-Feb-07 4:50 
QuestionUnderstanding the Garbage Collector Pin
AlexZieg7111-Feb-07 1:15
AlexZieg7111-Feb-07 1:15 
AnswerRe: Understanding the Garbage Collector Pin
S. Senthil Kumar11-Feb-07 2:28
S. Senthil Kumar11-Feb-07 2:28 
QuestionSelecting datagrid row by PK Pin
VargaMisha11-Feb-07 1:13
VargaMisha11-Feb-07 1:13 
QuestionI have a bug with a deployment project, help :( Pin
3DoorsDown11-Feb-07 0:53
3DoorsDown11-Feb-07 0:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.