Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[HELP C#] how do i disable the (X) button

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Tue Feb 12, 2008 1:20 pm    Post subject: [HELP C#] how do i disable the (X) button Reply with quote

how can i disable the exit button (X) in my form ?
i know that for maximize is this.maximizebox = false;
what is the command for exit button?

_________________
Stylo
Back to top
View user's profile Send private message
Renkokuken
GO Moderator
Reputation: 4

Joined: 22 Oct 2006
Posts: 3249

PostPosted: Tue Feb 12, 2008 1:23 pm    Post subject: Reply with quote

http://www.devhood.com/messages/message_view-2.aspx?thread_id=90408

There's a solution near the bottom.
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Tue Feb 12, 2008 1:36 pm    Post subject: Reply with quote

nice thx
btw how do make that if i'll press Yes on YesNo messagebox then it'll close my form?

_________________
Stylo
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Tue Feb 12, 2008 3:25 pm    Post subject: Reply with quote

Use the FormClosing event, I think
_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Tue Feb 12, 2008 3:28 pm    Post subject: Reply with quote

FormClosing/Button (if you disable ControlBox) Event:

DialogResult dr = MessageBox.Show( "Are You Sure You Want to Exit?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question );

if ( dr == DialogResult.Yes )
Close();

// if your doing FormClosing Event then you'll have to add this
else if ( dr == DialogResult.No )
e.Cancel();

if u want you can change it to MessageBoxButtons.YesNoCancel and then do

if ( dr == DialogResult.Cancel )
e.Cancel();

Usually you only use the cancel button if your closing statement is like "would you like to save before closing" then yes would save then close, no would just close, and cancel would cancel.

( e is defined in the Event function )

Also if u dont want the x box's to start just go into the form property, go to near the bottom and select ControlBox then set it to false. (better then calling it in Form1_Load

_________________
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Tue Feb 12, 2008 4:05 pm    Post subject: Reply with quote

this.ControlBox = false?
Though this disables all the buttons... you can do e.Cancel on FormClosing aswell.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites