0

This is the code... im trying to disable the close button and im new to coding. (c#)

namespace Lunar
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams parms = base.CreateParams;
                parms.ClassStyle |= 0x200;
                return parms;
            }
        }

the code that isnt working is the

protected override CreateParams CreateParams
            {
                get
                {
                    CreateParams parms = base.CreateParams;
                    parms.ClassStyle |= 0x200;
                    return parms;

the errors i have are:

CS0117 'Window' does not contain a definition for 'CreateParams'

CS0115 'MainWindow.CreateParams': no suitable method found to override

CS1061 'CreateParams' does not contain a definition for 'ClassStyle' and no accessible extension method 'ClassStyle' accepting a first argument of type 'CreateParams' could be found (are you missing a using directive or an assembly reference?)

pls help

lunar
  • 1

0 Answers0