Disable the Close [X] Button in C#!
All tutorials created in C# to be posted in here.
5 posts
Page 1 of 1
Since XTechVB did it in VB.NET I decided to convert it myself to C# AND HELP WITH CONVERTER
Create a new C# Project and double click or right click and click "View Code" to the code view!
Put this code above the public Form1()
So basically it will be:
ScreenShot:
Source Project: Enjoy the C# Code!
Create a new C# Project and double click or right click and click "View Code" to the code view!
Put this code above the public Form1()
Code: Select all
protected override CreateParams CreateParams {
get {
CreateParams cp = base.CreateParams;
const int CS_NOCLOSE = 0x200;
cp.ClassStyle = cp.ClassStyle | CS_NOCLOSE;
CS_NOCLOSE.ToString().Trim();
return cp;
}
}
So basically it will be:
Code: Select all
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
const int CS_NOCLOSE = 0x200;
cp.ClassStyle = cp.ClassStyle | CS_NOCLOSE;
CS_NOCLOSE.ToString().Trim();
return cp;
}
}
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
ScreenShot:
Source Project: Enjoy the C# Code!
You do not have the required permissions to view the files attached to this post.
Last edited by code it on Sun Apr 03, 2011 4:48 pm, edited 1 time in total.
Just out of curiosity,
Do you understand the codes?
Do you understand the codes?
Since I am learning a bit and i got help a bit from a converter forgot to mention that so i will
Nice tutorial but how did you get that button with the two arrows?
Instead of LOL use this -
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
CoderBoy1201 wrote:Nice tutorial but how did you get that button with the two arrows?That button is created by TeamVeiwer.
It is a control button.
5 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023